We investigate a diffusion process with a time-dependent diffusion coefficient, both exponentially increasing and decreasing in time,
D
(
t
)
=
D
0
e
±
2
α
t
. For this (hypothetical) nonstationary diffusion process we compute—both analytically and from extensive stochastic simulations—the behavior of the ensemble- and time-averaged mean-squared displacements (MSDs) of the particles, both in the over- and underdamped limits. Simple asymptotic relations derived for the short- and long-time behaviors are shown to be in excellent agreement with the results of simulations. The diffusive characteristics in the presence of ageing are also considered, with dramatic differences of the over- versus underdamped regime. Our results for
D
(
t
)
=
D
0
e
±
2
α
t
extend and generalize the class of diffusive systems obeying scaled Brownian motion featuring a power-law-like variation of the diffusivity with time,
D
(
t
)
∼
t
α
−
1
. We also examine the logarithmically increasing diffusivity,
D
(
t
)
=
D
0
log
[
t
/
τ
0
]
, as another fundamental functional dependence (in addition to the power-law and exponential) and as an example of diffusivity slowly varying in time. One of the main conclusions is that the behavior of the massive particles is predominantly ergodic, while weak ergodicity breaking is repeatedly found for the time-dependent diffusion of the massless particles at short times. The latter manifests itself in the nonequivalence of the (both nonaged and aged) MSD and the mean time-averaged MSD. The current findings are potentially applicable to a class of physical systems out of thermal equilibrium where a rapid increase or decrease of the particles’ diffusivity is inherently realized. One biological system potentially featuring all three types of time-dependent diffusion (power-law-like, exponential, and logarithmic) is water diffusion in the brain tissues, as we thoroughly discuss in the end.