summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/datetime2/samples/datetime2-sample-hyperref.tex
blob: ed881d5e0298961421eb2fe9f325452aad028a95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
% This file is public domain.
% This document additionally requires the datetime2-english module
% to be installed.

% arara: pdflatex
% arara: pdflatex
\documentclass[en-GB,en-US,en-AU]{article}

\usepackage[datesep=/,showzoneminutes=false]{datetime2}
\usepackage[colorlinks]{hyperref}

\DTMsetup{showdow}

\DTMsavetimestamp{mydate}{2014-06-03T12:45:02+01:00}

\begin{document}
\tableofcontents

The use of \verb|\typeout| is to test the expansion in the event
that the date/time needs to be written to an external file.
Use
\texttt{\href{http://www.dickimaw-books.com/latex/novices/html/texdoc.html}{texdoc} datetime2} to read the main user manual for
the \texttt{datetime2} package and use \texttt{texdoc
datetime2-english} for the English module documentation.

\section{Default date: \today}

Today: \today. Time: \DTMcurrenttime. Zone: \DTMcurrentzone.

Now: \DTMnow.

TWO DIGITS: \DTMtwodigits{2014}. \DTMtwodigits{2999}.
\DTMtwodigits{-2}.

\typeout{Date Stamp (Default): \DTMnow}

Saved date: \DTMusedate{mydate}.
Saved time: \DTMusetime{mydate}.

Saved date-time: \DTMuse{mydate}.

\typeout{Date Stamp (Default): \DTMuse{mydate}}

\section{Default time: \DTMusetime{mydate}}

\DTMsetstyle{iso}

ISO: \DTMnow.
\typeout{Date Stamp (ISO): \DTMnow}

Saved date: \DTMuse{mydate}.
\typeout{Date Stamp (ISO): \DTMuse{mydate}}

\DTMsetstyle{en-GB}
\section{(GB) \DTMusedate{mydate}}

en-GB: \DTMnow.
\typeout{Date Stamp (GB): \DTMnow}

Saved date: \DTMuse{mydate}.
\typeout{Date Stamp (GB): \DTMuse{mydate}}

\DTMsetstyle{en-US}
\section{(US) \DTMusedate{mydate}}

en-US: \DTMnow.
\typeout{Date Stamp (US): \DTMnow}

Saved date: \DTMuse{mydate}.
\typeout{Date Stamp (US): \DTMuse{mydate}}

\DTMsetstyle{en-AU}
\section{(AU) \DTMusedate{mydate}}

en-AU: \DTMnow.
\typeout{Date Stamp (AU): \DTMnow}

Saved date: \DTMuse{mydate}.
\typeout{Date Stamp (AU): \DTMuse{mydate}}

\end{document}