ds^2 = dx^2 + dy^2 + dz^2.
In Special Relativity, you define a quantity called the spacetime interval:
ds^2 = -(c*dt)^2 + dx^2 + dy^2 + dz^2.
You treat time as a 4th dimension, and take it into account when calculating distances. Notice that this interval can be negative (the metric is "semi-Riemannian"). "Events" (locations in 4D spacetime) can only be causally connected (one can influence the other) if the spacetime interval separating them is negative (this is equivalent to saying that no information can ever propagate faster than light).
The key is that all non-accelerating observers agree on the spacetime interval between any two events. The spacetime interval between two events is the only solid distance you can give. The time interval by itself depends on the observer's reference frame (you've probably heard of time dilation). So too does the spatial distance (length contraction). But time dilation and length contraction behave in such a way that the spacetime interval remains constant.
The long and the short of it is that time intervals are observer-dependent.