DEV Community

Cover image for ISO8601 Format in Latex
Mathieu Kerjouan
Mathieu Kerjouan

Posted on

ISO8601 Format in Latex

A quick note on Latex with datetime2, I wanted to add a Revision on my CV recently, and got a bit stuck with this package. I tried (again) chatgpt to fix this issue, and again, it failed. So, I just read the documentation, find the right options, and it was fixed.

%% header
\usepackage[calc,style=iso,showseconds,showzone]{datetime2}

%% document
\begin{document}
\today
\end{document}
Enter fullscreen mode Exit fullscreen mode

It will display the date/time with the ISO8601 format.

2026-07-25T10:03:00Z
Enter fullscreen mode Exit fullscreen mode

The idea here is to set few options while importing datetime2 module:

  • calc: Load the datetime2-calc package. This will allow the day of week to be computed and allow you to use the pgfcalendar offset style date formats in commands like \DTMdate as well as defining the commands described in Section 9. This option doesn’t take a value. It can’t be switched off. This option can’t be used in \DTMsetkeys. The default is to not load datetime2-calc;

  • style=iso: Sets the current style using \DTMsetstyle when the datetime2 package has finished loading. This also sets useregional=false but that setting can be overridden later in the option list;

  • showseconds: Boolean key to determine whether or not to show the seconds when the time is displayed;

  • showzone: Boolean key to determine whether or not to show the date with commands that use \DTMdisplay or \DTMDisplay.

Here some references if you want to know more about this topic:


Cover Image by Jon Tyson on Unsplash

Top comments (0)