We consider a diffusion and a wave equations ${\partial }_{t}^{k}u(x,t)=\mathrm{\Delta }u(x,t)+\mu \left(t\right)f\left(x\right),\mathrm{ }x\in \mathrm{\Omega },\mathrm{ }t>0,\mathrm{ }k=\mathrm{1,2}$ with the zero initial and boundary conditions, where $\mathrm{\Omega }\subset {\mathbb{R}}^{d}$ is a bounded domain. We establish uniqueness and/or stability results for inverse problems of determining $\mu \left(t\right),0<t<T$ with given f(x), determining $f\left(x\right),x\in \mathrm{\Omega }$ with given $\mu \left(t\right)$, by data of u : u(x0,⋅) with fixed point ${x}_{0}\in \mathrm{\Omega }$ or Neumann data on subboundary over time interval. In our inverse problems, data are taken over time interval T1<t<T2, by assuming that T<T1<T2 and $\mu \left(t\right)=0$ for $t\ge T$, which means that the source stops to be active after the time T and the observations are started only after T. This assumption is practical by such a posteriori data after incidents, although inverse problems had been well studied in the case of T=0. We establish the non-uniqueness, the uniqueness and conditional stability for a diffusion and a wave equations. The proofs are based on eigenfunction expansions of the solutions u(x,t), and we rely on various knowledge of the generalized Weierstrass theorem on polynomial approximation, almost periodic functions, Carleman estimate, non-harmonic Fourier series.