Photoionisation is one of the main processes that shape the gaseous environment of bright astrophysical sources, including Active Galactic Nuclei, Gamma-Ray Bursts and compact sources. Many information on the gas physics, chemistry and kinematics, as well as on the ionising source itself, can be gathered through optical to X-ray spectroscopy. Several time equilibrium photoionisation codes are publicly available and can be used to compute the gas ionisation and compare its spectroscopic imprint with the observations. However, as most (if not all) bright, accretion-powered sources are intrinsically variable, such codes are only able to offer an average description of the gas properties and, in extreme cases, can lead to erroneous diagnostics of its density, physics and geometry. In all these cases, time-evolving photoionisation is necessary to properly analyse the observations and consistently derive the gas properties. In this talk I will present the Time-Evolving Photo-Ionisation Device (TEPID; Luminari+23), a new code that self-consistently solves time-evolving photoionisation equations (with both thermal and ionisation balance) and accurately follows the response of the gas to changes in the ionising source. TEPID produces time-resolved gas absorption spectra that can be directly fitted to observations, from the optical up to the X-ray band. Along with the usual properties (ionisation, column density, velocity) time-evolving ionisation offers a unique channel to directly constrain the gas number density, which is a totally degenerate quantity at equilibrium. Such time-evolving codes are especially needed in the light of the recently-launched XRISM satellite, whose microcalorimeter Resolve will perform unprecedented high-resolution spectroscopy through the entire X-ray band, making equilibrium codes obsolete. Finally, I will present the applications of TEPID to two dramatically different environments (AGN ionised absorbers and circumburst environments of Gamma-Ray Bursts) to offer a glimpse of the unique capabilities offered by time-evolving photoionisation.