A Characterization of Cosmological Time Functions