What's the correct way to typeset a daytime in the format hh:mm:ss in math mode?

For example in $2:13,12\,\mathrm{min} = \SI{133,12}{s}$.


I don't know how to do this with siunitx, so I'll explain how I do it with a different package.

I use the datetime package. (I loaded both datetime and siunitx to the same document, and didn't get any conflicts, so you should be okay using both at the same time.) First I add the lines


to my preamble, which load the package, and select the HH:MM:SS format (more formats can be found in the package documentation).

Then the command \currenttime prints the current time; for example, "14:10:37", or I can print a specific time with \formattime{12}{29}{37}, which prints "12:29:37".

Since the spaces around the colons get expanded in a maths environment, e.g., "14 : 10 : 37", you might want to embed the time command in an \mbox{}, e.g.


This puts the time in a maths environment, and keeps consistent spacing with the rest of the document.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.