summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/datetime2/samples/datetime2-sample-filedate.tex
blob: bf9df37ce82390f613869059c585b5bbd40dd1b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
% This file is public domain.

% arara: pdflatex
% May also work with lualatex on some platforms (such as Linux)
% but the file mod date is not supported with xelatex.
% (The time zone %z format with Lua may not work on some platforms.)
% arara: pdflatex
\documentclass{article}

\usepackage{datetime2}

\begin{document}
Current date and time: \DTMnow.

\DTMsavefilemoddate{filemod}{\jobname.tex}

File modification date: \DTMuse{filemod}.

Save current date and time.
\DTMsavenow{mydate}

Now use it: \DTMuse{mydate}.
\end{document}