  Given a time function $\tau$ on a spacetime $M$, we define a `null distance
function', $\hat{d}_\tau$, built from and closely related to the causal
structure of $M$. In basic models with timelike $\nabla \tau$, we show that 1)
$\hat{d}_\tau$ is a definite distance function, which induces the manifold
topology, 2) the causal structure of $M$ is completely encoded in
$\hat{d}_\tau$ and $\tau$. In general, $\hat{d}_\tau$ is a conformally
invariant pseudometric, which may be indefinite. We give an `anti-Lipschitz'
condition on $\tau$, which ensures that $\hat{d}_\tau$ is definite, and show
this condition to be satisfied whenever $\tau$ has gradient vectors $\nabla
\tau$ almost everywhere, with $\nabla \tau$ locally `bounded away from the
light cones'. As a consequence, we show that the cosmological time function of
[1] is anti-Lipschitz when `regular', and hence induces a definite null
distance function. This provides what may be interpreted as a canonical metric
space structure on spacetimes which emanate from a common initial singularity,
e.g. a `big bang'.
