dim[4] contains the number of time points present.
pixdim[4] contains the time step, or TR.
The units are not required to be seconds, they can be
in any units available in the header...looks like
seconds, milliseconds, or microseconds, and in the
same field you can even specify hertz, ppm, or radians
as the "time" parameter.
rich