summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/datetime/datetime-manual.tex
blob: 0580c26cbc9860e726fab790a82859cb5fac3c90 (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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
\documentclass{nlctdoc}

\usepackage[colorlinks,
            bookmarks,
            bookmarksopen,
            hyperindex=false,
            pdfauthor={Nicola L.C. Talbot},
            pdftitle={datetime.sty: A Date and Time Package},
            pdfkeywords={date,time,LaTeX}]{hyperref}

\usepackage{creatdtx}

\begin{document}
\RecordChanges
\OnlyDescription

\title{datetime.sty v2.60: 
Formatting Current Date and Time}
 \author{Nicola L. C. Talbot\\[10pt]
 Dickimaw Books\\
 \url{http://www.dickimaw-books.com/}}
 \date{2015-03-20}
 \maketitle

\begin{important}
This is the last version of this package. The replacement package is
called \sty{datetime2} and will be released shortly after the
this final version.
\end{important}

 \tableofcontents

 \section{Introduction}
\changes{1.0}{2000/08/08}{First release}
\changes{1.01}{2000/09/18}{Documentation added}
The \styfmt{datetime} package is a \LaTeXe\ package that 
provides various different formats for \ics{today},
and provides commands for displaying the current time.  
If you only want the 
time commands but not the date changing commands, you can pass 
the option \pkgopt{nodate} to the package.
\changes{2.3}{2004/05/01}{nodate package option added}

\changes{2.41}{2004/10/22}{split package into two files: 
datetime.sty and fmtcount.sty}
Since version 2.4, the \styfmt{datetime} package has been 
separated into two packages: \styfmt{datetime} and 
\sty{fmtcount}.  When I originally created this package, 
I defined the commands, \ics{ordinal} etc which could be used 
in the definition of \cs{today}.  Since then, I have extended 
the number of commands available that can be used to display the 
value of a \LaTeX\ counter, however it seems more appropriate to 
define all these counter-related commands in a separate package. 
The \sty{fmtcount} package is now distributed separately 
from the \styfmt{datetime} package, and will also need to 
be installed.

\changes{2.42}{2004/11/01}{made package compatible with babel}
As from version 2.42, the \styfmt{datetime} package is now 
compatible with \sty{babel}, however you must load the 
\styfmt{datetime} package \emph{after} the \sty{babel} package.  
For example:
\begin{verbatim}
\usepackage[francais]{babel}
\usepackage{datetime}
\end{verbatim}

 \section{Predefined Date Formats}
 There are various declarations that change the effect of 
\ics{today}.  The change can be localised by placing the 
declaration within a group.

As from version 2.43, the numerical date formats (such as 
\ics{ddmmyyyydate}) use the command
\begin{definition}[\DescribeMacro{\dateseparator}]
\cs{dateseparator}
\end{definition}
to separate the numbers.  So, for example, if you want to hyphens
instead of slashes, you can do:
\begin{verbatim}
\renewcommand{\dateseparator}{-}
\end{verbatim}

\subsection{ISO format}

\begin{definition}[\DescribeMacro{\yyyymmdddate}]
\cs{yyyymmdddate}
\end{definition}
This declaration will redefine \ics{today} to produce the current
date displayed in the form 2000/03/08. (You can redefine
\ics{dateseparator} to \texttt{-} to change to 2000-03-08.)

\subsection{\texorpdfstring{\meta{Day} \meta{Month} \meta{Year}}{Day Month Year} formats}

\begin{definition}[\DescribeMacro{\longdate}]
\cs{longdate}
\end{definition}
This declaration will redefine \ics{today} to produce the current
date displayed in the form Wednesday 8\textsuperscript{th} March,
2000 if the package option \pkgopt{dayofweek} is used, or
8\textsuperscript{th} March, 2000 if the package option
\pkgopt{nodayofweek} is used.

\begin{definition}[\DescribeMacro{\shortdate}]
\cs{shortdate}
\end{definition}
This declaration will redefine \ics{today} to produce the current
date displayed in the form Wed 8\textsuperscript{th} Mar, 2000 if
the package option \pkgopt{dayofweek} is used, or
8\textsuperscript{th} Mar, 2000 if the package option
\pkgopt{nodayofweek} is used.

\begin{definition}[\DescribeMacro{\ddmmyyyydate}]
\cs{ddmmyyyydate}
\end{definition}
This declaration will redefine \ics{today} to produce the current
date displayed in the form 08/03/2000.

\begin{definition}[\DescribeMacro{\dmyyyydate}]
\cs{dmyyyydate}
\end{definition}
This declaration will redefine \ics{today} to produce the current
date displayed in the form 8/3/2000.

\begin{definition}[\DescribeMacro{\ddmmyydate}]
\cs{ddmmyydate}
\end{definition}
This declaration will redefine \ics{today} to produce the current
date displayed in the form 08/03/00.

\begin{definition}[\DescribeMacro{\dmyydate}]
\cs{dmyydate}
\end{definition}
This declaration will redefine \ics{today} to produce the current
date displayed in the form 8/3/00.

\begin{definition}[\DescribeMacro{\textdate}]
\cs{textdate}
\end{definition}
This declaration will redefine \ics{today} to produce the current
date displayed in the form: Wednesday the Eighth of March, Two
Thousand if the package option \pkgopt{dayofweek} is used, or Eighth
of March, Two Thousand if the package option \pkgopt{nodayofweek} is
used. Note that \cs{textdate} is defined for use with English, it
won't look right if it is used when another language has been
selected\footnote{in fact, you may get an error from the
\sty{fmtcount} package if you are using a language that it doesn't
support.}.  If you want to define a similar command for another
language, you will first need to check that the \sty{fmtcount}
package supports that language.

\subsection{\texorpdfstring{\meta{Month} \meta{Day} \meta{Year}}{Month Day Year} formats}

\begin{definition}[\DescribeMacro{\usdate}]
\cs{usdate}
\end{definition}
This declaration will redefine \cs{today} to produce the current
date displayed in the form March 8, 2000. (As \TeX\ and \LaTeX\ do
by default.)

\begin{definition}[\DescribeMacro{\mmddyyyydate}]
\cs{mmddyyyydate}
\end{definition}
This declaration will redefine \ics{today} to produce the current
date displayed in the form 03/08/2000.

\begin{definition}[\DescribeMacro{\mdyyyydate}]
\cs{mdyyyydate}
\end{definition}
This declaration will redefine \verb"\today" to produce the current
date displayed in the form 3/8/2000.

\begin{definition}[\DescribeMacro{\mmddyydate}]
\cs{mmddyydate}
\end{definition}
This declaration will redefine \ics{today} to produce the current
date displayed in the form 03/08/00.

\begin{definition}[\DescribeMacro{\mdyydate}]
\cs{mdyydate}
\end{definition}
This declaration will redefine \ics{today} to produce the current
date displayed in the form 3/8/00.

\subsection{Dates defined by \texorpdfstring{\styfmt{babel}}{babel}}

In addition to the above, the declarations \cs{date}\meta{lang} are
available for all languages defined either by calling \sty{babel}
prior to \styfmt{datetime} or by passing the language name as an
option to \styfmt{datetime}.  See~\sectionref{sec:newdate} if you
want to define your own customised date format.

 \section{Time Commands}

The current time is displayed using the command 
\begin{definition}[\DescribeMacro{\currenttime}]
\cs{currenttime}
\end{definition}

A specific time can be displayed using the command
\begin{definition}[\DescribeMacro{\formattime}]
\cs{formattime}\marg{hour}\marg{minute}\marg{second}
\end{definition}
where \meta{hour} is a number from~0 to~23, and \meta{minute} and
\meta{second} are numbers from~0 to~59.

The format can be changed using the declaration
\begin{definition}[\DescribeMacro{\settimeformat}]
\cs{settimeformat}\marg{style}
\end{definition}
where \meta{style} is the name of the
format. Predefined formats are:
\begin{description}
\item[xxivtime] Twenty-four hour time in the form 22:28 (Default)
\item[hhmmsstime] Twenty-four hour time in the form 22:28:00
\item[ampmtime] Twelve hour time in the form 10:28pm
\item[oclock] Displays the current time as a string, e.g.\ 
Twenty-Eight minutes past Ten in the afternoon.
\end{description}

New time formats can be defined using the command:
\begin{definition}[\DescribeMacro{\newtimeformat}]
\cs{newtimeformat}\marg{name}\marg{format}
\end{definition}
where \meta{name} is the name of the new format (used in
\ics{settimeformat}), and \meta{format} is how to format the time.
Within \meta{format} you can use the counters \ctr{HOUR} (number
of hours after midnight), \ctr{MINUTE} (number of minutes past
the hour), \ctr{SECOND} (number of seconds) \ctr{HOURXII}
(number of hours after midnight/midday), \ctr{TOHOUR} (the next
hour) and \ctr{TOMINUTE} (number of minutes to the next hour),
and the corresponding commands: \ics{THEHOUR}, \ics{THEMINUTE},
\ics{THESECOND}, \ics{THEHOURXII}, \ics{THETOHOUR} and
\ics{THETOMINUTE}.

For example, to define a new time format that uses a dot instead of a
colon:
\begin{verbatim}
\newtimeformat{dottime}{\twodigit{\THEHOUR}.\twodigit{\THEMINUTE}}
\end{verbatim}
You then need to switch to this new format before you can use it:
\begin{verbatim}
\settimeformat{dottime}
\currenttime
\end{verbatim}

As from version 2.43, if you only want to change the separator, 
you can simply redefine
\begin{definition}[\DescribeMacro{\timeseparator}]
\cs{timeseparator}
\end{definition}
instead of defining a new time format.  For example:
\begin{verbatim}
\renewcommand{\timeseparator}{.}
\end{verbatim}
The \texttt{xxivtime} format will now work like the \texttt{dottime} 
format defined above.

 \section{Formating Dates}
\begin{definition}[\DescribeMacro{\pdfdate}]
\cs{pdfdate}
\end{definition}
 This command\footnote{thanks to Ulrich Dirr for 
asking about this} prints the date in the format required for
 PDF files, e.g.\ if the date is 1 May 2004 and time is
 22:02, \verb"\pdfdate" will print 20040501220200.  The reason 
this date format is separate from all the others is because the 
other form doesn't get properly expanded by PDF\TeX. (This 
command is defined regardless of whether the package option 
\texttt{nodate} is called.)
Example:
\begin{verbatim}
\pdfinfo{
   /Author (Me)
   /Title (A Sample Document)
   /CreationDate (D:20040501215500)
   /ModDate (D:\pdfdate)
}
\end{verbatim}
\textbf{Note} that PDF\TeX\ introduced the new primitive
\cs{pdfcreationdate} in version 1.30.0, so \cs{pdfdate} isn't
required with newer versions of PDF\TeX. (\cs{pdfcreationdate}
is better than \cs{pdfdate} as it also stores the time zone.)
 
 There are two commands that print the name of the current
 month:
\begin{definition}[\DescribeMacro{\monthname}]
\cs{monthname}\oarg{num}
\end{definition}
prints the current month name in full, 
e.g.\ August, and 
\begin{definition}[\DescribeMacro{\shortmonthname}]
\cs{shortmonthname}\oarg{num}
\end{definition}
prints the abbreviated month name, e.g.\ Aug.  Both \cs{monthname}
and \cs{shortmonthname} take an optional argument (a number from 1
to 12) if the name of a specific month is required.  For example,
\verb"\monthname[6]" will produced the output: June.

 The day of the week is computed using the algorithm documented at
 \url{http://userpages.wittenburg.edu/bshelburne/Comp150/DayOfWeek.htm}.
 This algorithm works for any date between 1\textsuperscript{st} 
Jan, 1901 and 31\textsuperscript{st} Dec, 2099.
 The following macros display the day of week for a given date:

\begin{definition}[\DescribeMacro{\dayofweekname}]
\cs{dayofweekname}\marg{day}\marg{month}\marg{year}
\end{definition}
prints the day of week for the specified date.  For example, 
\begin{verbatim}
\dayofweekname{31}{10}{2002}
\end{verbatim}
will produce the output: Thursday.

\begin{definition}[\DescribeMacro{\shortdayofweekname}]
\cs{shortdayofweekname}\meta{day}\marg{month}\marg{year}
\end{definition}
prints the abbreviated name for the day of week for the specified
date. For example
\begin{verbatim}
\shortdayofweekname{31}{10}{2002}
\end{verbatim}
will produce the output: Thu.

\begin{definition}[\DescribeMacro{\ifshowdow}]
\cs{ifshowdow}
\end{definition}
This \TeX\ conditional can be used to determine whether or not the
option \pkgopt{dayofweek} has been passed to the package. For
example:
\begin{verbatim}
\ifshowdow\dayofweekname{31}{10}{2002} \fi
\end{verbatim}
will only display the day of week if the \pkgopt{dayofweek} option
was passed to \styfmt{datetime}. Alternatively, you can use
David~Carlisle's \sty{ifthen} package:
\begin{verbatim}
\ifthenelse{\boolean{showdow}}{\dayofweekname{31}{10}{2002} }{}
\end{verbatim}

The command
\begin{definition}[\DescribeMacro{\ordinaldate}]
\cs{ordinaldate}\marg{number}
\end{definition}
displays \meta{number} as a date-type ordinal. If the current
language is English, this will simply pass the argument to
\ics{ordinalnum} (defined in the \sty{fmtcount} package), if the
current language is Breton, Welsh or French, a superscript will only
be added if \meta{number} is 1, otherwise only \meta{number} will be
displayed.

The macro\footnote{Note the name change since version 1.1. The
command name was changed from \cs{thedate} to \cs{formatdate} to
avoid a name clash when using the \sty{seminar} class file.}
\begin{definition}[\DescribeMacro{\formatdate}]
\cs{formatdate}\marg{day}\marg{month}\marg{year}
\end{definition}
formats the specified date according to the current format of
\ics{today}\footnote{To be more precise, \ics{today} is defined to
be \ics{formatdate}\{\cs{day}\}\{\cs{month}\}\{\cs{year}\} where
\ics{longdate} etc change the definition of \cs{formatdate}}.
(Arguments must all be integers.) For example, in combination with
\ics{longdate}, the command
\begin{verbatim}
\formatdate{27}{9}{2004}
\end{verbatim}
will produce the output: Monday 27\textsuperscript{th} September,
2004.

You can ensure that a number is displayed with at least two digits
using the command
\begin{definition}[\DescribeMacro{\twodigit}]
\cs{twodigit}\marg{num}
\end{definition}

\section{Defining New Date Formats}\label{sec:newdate}

New date formats can be defined using the command:
\begin{definition}[\DescribeMacro{\newdateformat}]
 \cs{newdateformat}\marg{name}\marg{format}
\end{definition}
where \meta{name} is the name of the new format, and \meta{format}
is how to format the date. Within the argument \meta{format} you can
use the commands \ics{THEDAY}, \ics{THEMONTH} and \ics{THEYEAR} to
represent the relevant day, month and year, or you can use the
counters \ctr{DAY}, \ctr{MONTH} and \ctr{YEAR} if you want to use
\ics{ordinal} etc. Once you have defined the new date format, you
can then switch to it using the declaration \verb'\'\meta{name}
(i.e.\ the name you specified preceded by a backslash), and
subsequent calls to \ics{today} and \ics{formatdate} will use your
new format.

For example, suppose you want to define a new date format called,
say, \texttt{mydate}, that will typeset the date in the form: 
8-3-2002, then you can do:
\begin{verbatim}
\newdateformat{mydate}{\THEDAY-\THEMONTH-\THEYEAR}
\end{verbatim}
\ics{newdateformat} will then define the declaration 
\cs{mydate} which can be used to
switch to your new format. In the following example, 
two new date formats are defined, and they are then
selected to produce two different formats for the current date:
\begin{verbatim}
\newdateformat{dashdate}{%
\twodigit{\THEDAY}-\twodigit{\THEMONTH}-\THEYEAR}

\newdateformat{usvardate}{%
\monthname[\THEMONTH] \ordinal{DAY}, \THEYEAR}

Dash: \dashdate\today.
US: \usvardate\today.
\end{verbatim}
If the current date is, say, 8th March, 2002, the above code will
produce the following: Dash: 08-03-2002.  US: March
8\textsuperscript{th}, 2002.

Note that \ics{THEDAY} etc and \ctr{DAY} etc have no real 
meaning outside \ics{newdateformat} (this is why they 
are in uppercase). Incidentally, the \texttt{dashdate} format
is not really necessary, as you can achieve this format
using:
\begin{verbatim}
\renewcommand{\dateseparator}{-}
\ddmmyyyydate
\end{verbatim}

Another note: in the above code, \ics{ordinal} was
used to illustrate the use of the \ctr{DAY} counter.  It
is better to use \ics{ordinaldate} instead:
\begin{verbatim}
\newdateformat{usvardate}{%
\monthname[\THEMONTH] \ordinaldate{\THEDAY}, \THEYEAR}
\end{verbatim}

\section{Saving Dates}

It is possible to save a date for later use using the command:
\footnote{Thanks to Denis Bitouz\'e for asking about this}
\begin{definition}[\DescribeMacro{\newdate}]
\cs{newdate}\marg{name}\marg{day}\marg{month}\marg{year}
\end{definition}

This date can later be displayed using the same format as that
used by \ics{formatdate} using the command:
\begin{definition}[\DescribeMacro{\displaydate}]
\cs{displaydate}\marg{name}
\end{definition}

Individual elements of the date can be extracted using the
commands:
\begin{definition}[\DescribeMacro{\getdateday}]
\cs{getdateday}\marg{name}
\end{definition}
\begin{definition}[\DescribeMacro{\getdatemonth}]
\cs{getdatemonth}\marg{name}
\end{definition}
\begin{definition}[\DescribeMacro{\getdateyear}]
\cs{getdateyear}\marg{name}
\end{definition}

\section{Predefined Names}

The following commands are defined by the \styfmt{datetime} 
package:

\begin{tabular}{ll}
\bfseries Command Name & \bfseries Default Value\\
\ics{dateseparator} & \verb'/'\\
\ics{timeseparator} & \verb':'\\
\ics{amname} & \texttt{am}\\
\ics{pmname} & \texttt{pm}\\
\ics{amorpmname} & \ics{amname} if morning, otherwise \ics{pmname}\\
\ics{amstring} & \texttt{in the morning}\\
\ics{pmstring} & \texttt{in the afternoon}\\
\ics{amorpmstring} & \ics{amstring} if morning, otherwise 
\ics{pmstring}\\
\ics{halfpast} & \texttt{Half past}\\
\ics{quarterpast} & \texttt{Quarter past}\\
\ics{quarterto} & \texttt{Quarter to}\\
\ics{noon} & \texttt{Noon}\\
\ics{midnight} & \texttt{Midnight}\\
\ics{oclockstring} & \texttt{O'Clock}
\end{tabular}

\section{Package Options}

 The following options may be passed to this package:
\begin{description}
\item[\pkgopt{long}] make \cs{today} produce long date
\item[\pkgopt{short}] make \cs{today} produce short date
\item[\pkgopt{yyyymmdd}] make \cs{today} produce YYYY/MM/DD date
\item[\pkgopt{ddmmyyyy}] make \cs{today} produce DD/MM/YYYY date
\item[\pkgopt{dmyyyy}] make \cs{today} produce D/M/YYYY date
\item[\pkgopt{ddmmyy}] make \cs{today} produce DD/MM/YY date
\item[\pkgopt{dmyy}] make \cs{today} produce D/M/YY date
\item[\pkgopt{text}] make \cs{today} produce text date in UK style
\item[\pkgopt{us}] make \cs{today} produce US style date
\item[\pkgopt{mmddyyyy}] make \cs{today} produce MM/DD/YYYY date
\item[\pkgopt{mdyyyy}] make \cs{today} produce M/D/YYYY date
\item[\pkgopt{mmddyy}] make \cs{today} produce MM/DD/YY date
\item[\pkgopt{mdyy}] make \cs{today} produce M/D/YY date
\item[\pkgopt{raise}] make ordinal st,nd,rd,th appear as superscript
\item[\pkgopt{level}] make ordinal st,nd,rd,th appear level with rest of 
text
\item[\pkgopt{dayofweek}] make the day of week appear for \ics{longdate}, 
\ics{shortdate} 
            or \ics{textdate}
\item[\pkgopt{nodayofweek}] don't display the day of week.
\item[\pkgopt{hhmmss}] make \cs{currenttime} produce \texttt{hhmmsstime} 
format
\item[\pkgopt{24hr}] make \cs{currenttime} produce \texttt{xxivtime} 
format
\item[\pkgopt{12hr}] make \cs{currenttime} produce \texttt{ampmtime} 
format
\item[\pkgopt{oclock}] make \cs{currenttime} produce \texttt{oclock} 
format
\item[\pkgopt{nodate}] Don't redefine \cs{today} or define the month or 
day of week commands
           (useful if you only want the time commands) 
\item[\pkgopt{iso}] as \pkgopt{ddmmyyyy} and \pkgopt{hhmmss} but
also sets date separator to \texttt{-}
 and time separator to \texttt{:}
 \end{description}

The default options are: \pkgopt{long}, \pkgopt{raise},
\pkgopt{dayofweek} and \pkgopt{24hr}.

\section{Multilingual Support}

If you use the \sty{ngerman} package, you must use \styfmt{datetime}'s
\pkgopt{ngerman} package option if you want the date displayed
in the same form as \sty{ngerman}. You must also load \sty{ngerman}
\emph{before} you load \styfmt{datetime}. Similarly for the
\sty{german} package.

If you want to use the \sty{babel} package, you must load
it \emph{before} you load the \styfmt{datetime} package. This
is because the \sty{babel} \cs{date}\meta{lang} commands
redefine \ics{today}, whereas the \sty{datetime} package
redefines \cs{today} to use \ics{formatdate}, and the
date formatting commands (such as \ics{longdate}) redefine
\cs{formatdate} rather than \cs{today}. This ensures 
consistent formatting of the dates whether you use \cs{today} or
\cs{formatdate}.  Therefore, the \styfmt{datetime} package
has to redefine all the \cs{date}\meta{lang} commands accordingly.
Thus the multilingual date support is mostly limited to that provided
by \sty{babel}. Additional support, such as the day of
week names and abbreviations, are only supplied for those
languages that I know, or that other people have been able to supply
for me.

As from v2.56, the package options supplied to \styfmt{datetime}
override \sty{babel}'s date format. For example:
\begin{verbatim}
\usepackage[french,spanish]{babel}
\usepackage[ddmmyyyy]{datetime}
\end{verbatim}
will use ddmmyyyy date format regardless of language. Note that
if you use a declaration instead of a package option, for
example:
\begin{verbatim}
\usepackage[french,spanish]{babel}
\usepackage{datetime}
\ddmmyyyydate
\end{verbatim}
the date format will be switched back to \cs{datefrench} or
\cs{datespanish} whenever the language is set. You can use
\begin{definition}[\DescribeMacro{\setdefaultdate}]
\cs{setdefaultdate}\marg{declaration}
\end{definition}
to always use \marg{declaration} whenever the language
is set. For example:
\begin{verbatim}
\setdefaultdate{\ddmmyyyydate}
\end{verbatim}

The commands \ics{monthname} and \ics{shortmonthname},
will produce the month name in the current language.
If you want the month name in a specific language, you
can use the command \cs{monthname}\meta{lang}.
For example, \verb"\monthnamefrench[6]" will produce the output: 
juin. Note that \ics{textdate} is formatted for English dates,
and won't look right if used with another language setting. If you
want a textual date, the \sty{fmtcount} package (which is 
loaded by \styfmt{datetime}) defines some commands which display
a number or ordinal as a word, but it only has very limited 
multilingual support. See the \sty{fmtcount} documentation 
for further details.

\section{Registers}

\TeX\ provides \ics{day}, \ics{month} and \ics{year} registers. In
addition, \styfmt{datetime} provides the registers: 
\ics{currenthour}, \ics{currentminute} and \ics{currentsecond}. 
Note that old distributions of \TeX\ will always have
\cs{currentsecond} set to zero.

\section{Configuration File}

As from Version 2.4, the \styfmt{datetime} package will read in settings
from the configuration file \texttt{datetime.cfg}, if it exists,
which will override the default package options.  For example,
suppose you prefer a short date without the day of week by default,
you will need to create a file called \texttt{datetime.cfg} that
contains the line:
\begin{verbatim}
\shortdate\showdowfalse
\end{verbatim}
The file \texttt{datetime.cfg} should then go somewhere on the 
\TeX\ path.  Now all you need to do is:
\begin{verbatim}
\usepackage{datetime}
\end{verbatim}
without having to specify the \pkgopt{short} and 
\pkgopt{nodayofweek} options.

You can also use this file to define and set your own date 
styles.  For example, you could create
a configuration file that has the following lines:
\begin{verbatim}
\newdateformat{dashdate}{\twodigit{\THEDAY}-\twodigit{\THEMONTH}-\THEYEAR}
\dashdate
\end{verbatim}
Whenever you use the \styfmt{datetime} package, it will now 
use this format by default.

\section{LaTeX2HTML styles}

\changes{2.43}{2005/02/25}{Added LaTeX2HTML support}%
\changes{2.44}{2005/03/03}{Fixed minor bugs in Perl scripts}
Version 2.43 and above of the \styfmt{datetime} bundle 
supplies the LaTeX2HTML style file \texttt{datetime.perl}.  
This file should be placed in a 
directory searched by LaTeX2HTML.  The following limitations 
apply to the LaTeX2HTML styles:

\begin{itemize}
\item The configuration file \texttt{datetime.cfg}
is currently ignored.  You can however
do:
\begin{verbatim}
\usepackage{datetime}
\html{\input{datetime.cfg}}
\end{verbatim}
This, I agree, is an unpleasant cludge.

\item The commands \cs{monthname}\meta{language} are not 
implemented.

\item Some of the languages are not implemented.

\item The package option \pkgopt{nodate} is not implemented.

\end{itemize}

\section{Troubleshooting}

There is a \sty{datetime} FAQ available at:
\url{http://www.dickimaw-books.com/faqs/datetimefaq.html}.

\StopEventually{\phantomsection
\addcontentsline{toc}{section}{Index}\PrintIndex
}

\end{document}