  We report on the derivation of determinant representations for the Green's
functions and spectral function of the trapped Tonks-Girardeau gas on the
lattice and in the continuum. Our results are valid for any type of statistics
of the constituent particles, at zero and finite temperature and arbitrary
confining potentials, including nonequilibrium scenarios induced by sudden
changes of the external potential. In addition, they are also extremely
efficient and easy to implement numerically with the main computational effort
being represented by the calculation of partial overlaps of the dynamically
evolved single particle wavefunctions. In the lattice case we show that the
spectral function of a system with a strong harmonic potential presents only
two singular lines compared with three singular lines in the case of a
homogeneous system.
