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
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with LaTeX2HTML 2002 (1.67)
original version by: Nikos Drakos, CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>datetime.sty v2.55: Formatting Current Date and Time</TITLE>
<META NAME="description" CONTENT="datetime.sty v2.55: Formatting Current Date and Time">
<META NAME="keywords" CONTENT="manual">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="LaTeX2HTML v2002">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
</HEAD>
<BODY >
<P>
<H1 ALIGN="CENTER">datetime.sty v2.55: Formatting Current Date and
Time</H1>
<P ALIGN="CENTER"><STRONG>Nicola L. C. Talbot
<BR>
<BR>
School of Computing Sciences
<BR>
University of East Anglia
<BR>
Norwich. NR4 7TJ.
<BR>
United Kingdom.
<BR> <TT><A NAME="tex2html1"
HREF="http://theoval.cmp.uea.ac.uk/~nlct/">http://theoval.cmp.uea.ac.uk/~nlct/</A></TT></STRONG></P>
<P ALIGN="CENTER"><STRONG>20 Aug 2007</STRONG></P>
<BR>
<H2><A NAME="SECTION00010000000000000000">
Contents</A>
</H2>
<!--Table of Contents-->
<UL>
<LI><A NAME="tex2html24"
HREF="manual.html#SECTION00020000000000000000">Introduction</A>
<LI><A NAME="tex2html25"
HREF="manual.html#SECTION00030000000000000000">Date Declarations</A>
<LI><A NAME="tex2html26"
HREF="manual.html#SECTION00040000000000000000">Time Commands</A>
<LI><A NAME="tex2html27"
HREF="manual.html#SECTION00050000000000000000">Formating Dates</A>
<LI><A NAME="tex2html28"
HREF="manual.html#SECTION00060000000000000000">Defining New Date Formats</A>
<LI><A NAME="tex2html29"
HREF="manual.html#SECTION00070000000000000000">Saving Dates</A>
<LI><A NAME="tex2html30"
HREF="manual.html#SECTION00080000000000000000">Predefined Names</A>
<LI><A NAME="tex2html31"
HREF="manual.html#SECTION00090000000000000000">Package Options</A>
<LI><A NAME="tex2html32"
HREF="manual.html#SECTION000100000000000000000">Multilingual Support</A>
<LI><A NAME="tex2html33"
HREF="manual.html#SECTION000110000000000000000">Configuration File</A>
<LI><A NAME="tex2html34"
HREF="manual.html#SECTION000120000000000000000">LaTeX2HTML styles</A>
<LI><A NAME="tex2html35"
HREF="manual.html#SECTION000130000000000000000">Troubleshooting</A>
</UL>
<!--End of Table of Contents-->
<H1><A NAME="SECTION00020000000000000000">
Introduction</A>
</H1>
The <TT>datetime</TT> package is a LaTeX2e package that
provides various different formats for <TT>\today</TT>,
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 <TT>nodate</TT> to the package.
<P>
Since version 2.4, the <TT>datetime</TT> package has been
separated into two packages: <TT>datetime</TT> and
<TT>fmtcount</TT>. When I originally created this package,
I defined the commands, <TT>\ordinal</TT> etc which could be used
in the definition of <TT>\today</TT>. 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 <TT>fmtcount</TT> package is now distributed separately
from the <TT>datetime</TT> package, and will also need to
be installed.
<P>
As from version 2.42, the <TT>datetime</TT> package is now
compatible with <TT>babel</TT>, however you must load the
<TT>datetime</TT> package <I>after</I> the <TT>babel</TT> package.
For example:
<PRE>
\usepackage[francais]{babel}
\usepackage{datetime}
</PRE>
<P>
<H1><A NAME="SECTION00030000000000000000">
Date Declarations</A>
</H1>
There are various declarations that change the effect of
<TT>\today</TT>. The change can be localised by placing the
declaration within a group.
<P>
<I>Day</I> <I>Month</I> <I>Year</I> formats:
<BR>
The declaration <code>\longdate</code> will redefine
<code>\today</code> to produce the current date displayed in the form
Wednesday 8<SUP>th</SUP> March, 2000
if the package option <TT>dayofweek</TT> is used, or
8<SUP>th</SUP> March, 2000 if the package option
<TT>nodayofweek</TT> is used.
<BR>
The declaration <code>\shortdate</code> will redefine
<code>\today</code> to produce the current date displayed in the form
Wed 8<SUP>th</SUP> Mar, 2000 if the package option
<TT>dayofweek</TT> is used, or 8<SUP>th</SUP> Mar, 2000
if the package option <TT>nodayofweek</TT> is used.
<BR>
The declaration <code>\ddmmyyyydate</code> will redefine
<code>\today</code> to produce
the current date displayed in the form 08/03/2000
<BR>
The declaration <code>\dmyyyydate</code> will redefine
<code>\today</code> to produce
the current date displayed in the form 8/3/2000
<BR>
The declaration <code>\ddmmyydate</code> will redefine
<code>\today</code> to produce
the current date displayed in the form 08/03/00
<BR>
The declaration <code>\dmyydate</code> will redefine
<code>\today</code> to produce
the current date displayed in the form 8/3/00
<BR>
The declaration <code>\textdate</code> will redefine
<code>\today</code> to produce the current date displayed in the form:
Wednesday the Eighth of March, Two Thousand if the package option
<TT>dayofweek</TT> is used, or Eighth of March, Two Thousand if
the package option <TT>nodayofweek</TT> is used. Note that
<code>\textdate</code> is defined for use with English, it won't
look right if it is used when another language has been
selected<A NAME="tex2html2"
HREF="#foot411"><SUP>1</SUP></A>. If you want to define a similar command for
another language, you will first need to check that the
<TT>fmtcount</TT> package supports that language.
<P>
<I>Month</I> <I>Day</I> <I>Year</I> formats:
<BR>
The declaration <code>\usdate</code> will redefine
<code>\today</code> to produce the current date displayed in the form
March 8, 2000. (As TeX and LaTeX do by default.)
<BR>
The declaration <code>\mmddyyyydate</code> will redefine
<code>\today</code> to produce the current date displayed in the form
03/08/2000
<BR>
The declaration <code>\mdyyyydate</code> will redefine
<code>\today</code> to produce the current date displayed in the form
3/8/2000
<BR>
The declaration <code>\mmddyydate</code> will redefine
<code>\today</code> to produce the current date displayed in the form
03/08/00
<BR>
The declaration <code>\mdyydate</code> will redefine
<code>\today</code> to produce the current date displayed in the form
3/8/00
<P>
In addition, the declarations <code>\date</code><I>lang</I> are
available for all languages defined either by
calling <TT>babel</TT> prior to <TT>datetime</TT> or by
passing the language name as an option to <TT>datetime</TT>.
See <A HREF="manual.html#sec:newdate">later</A>
if you want to define your own customised date format.
<P>
As from version 2.43, the numerical date formats (such as
<code>\ddmmyyyydate</code>) use the command
<code>\dateseparator</code> to separate the numbers. So, for example,
if you want to hyphens instead of slashes, you can do:
<PRE>
\renewcommand{\dateseparator}{-}
</PRE>
<P>
<H1><A NAME="SECTION00040000000000000000">
Time Commands</A>
</H1>
The current time is displayed using the command
<code>\currenttime</code>.
The format can be changed using the declaration
<TT>\settimeformat{</TT><EM>style</EM><TT>}</TT>, where <I>style</I> is the name of the
format<A NAME="tex2html3"
HREF="#foot416"><SUP>2</SUP></A>. Available formats
are:
<DL>
<DT><STRONG>xxivtime</STRONG></DT>
<DD>Twenty-four hour time in the form 22:28 (Default)
</DD>
<DT><STRONG>ampmtime</STRONG></DT>
<DD>Twelve hour time in the form 10:28pm
</DD>
<DT><STRONG>oclock</STRONG></DT>
<DD>Displays the current time as a string, e.g.
Twenty-Eight minutes past Ten in the afternoon.
</DD>
</DL>
<P>
New time formats can be defined using the command:
<BR>
<BR><TT>\newtimeformat{</TT><EM>name</EM><TT>}{</TT><EM>format</EM><TT>}</TT>
<BR>
<BR>
where <I>name</I> is the name of the new format (used in
<TT>\settimeformat</TT>), and <I>format</I> is how to format the
time. Within <I>format</I> you can use the counters
<TT>HOUR</TT> (number of hours after midnight), <TT>MINUTE</TT>
(number of minutes past the hour), <TT>HOURXII</TT> (number of
hours after midnight/midday), <TT>TOHOUR</TT> (the next hour) and
<TT>TOMINUTE</TT> (number of minutes to the next hour), and the
corresponding commands: <TT>\THEHOUR</TT>, <TT>\THEMINUTE</TT>,
<TT>\THEHOURXII</TT>, <TT>\THETOHOUR</TT> and <TT>\THETOMINUTE</TT>.
<P>
For example, to define a new time format that uses a dot instead of a
colon:
<PRE>
\newtimeformat{dottime}{\twodigit{\THEHOUR}.\twodigit{\THEMINUTE}}
</PRE>
You then need to switch to this new format before you can use it:
<PRE>
\settimeformat{dottime}
\currenttime
</PRE>
<P>
As from version 2.43, if you only want to change the separator,
you can simply redefine <TT>\timeseparator</TT>
instead of defining a new time format. For example:
<PRE>
\renewcommand{\timeseparator}{.}
</PRE>
The <TT>xxivtime</TT> format will now work like the <TT>dottime</TT>
format defined above.
<P>
<H1><A NAME="SECTION00050000000000000000">
Formating Dates</A>
</H1>
The command <code>\pdfdate</code><A NAME="tex2html4"
HREF="#foot148"><SUP>3</SUP></A> prints the date in the format required for
PDF files, e.g. if the date is 1 May 2004 and time is
22:02, <code>\pdfdate</code> 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 PDFTeX. (This
command is defined regardless of whether the package option
<TT>nodate</TT> is called.)
Example:
<PRE>
\pdfinfo{
/Author (Me)
/Title (A Sample Document)
/CreationDate (D:20040501215500)
/ModDate (D:\pdfdate)
}
</PRE>
<P>
There are two commands that print the name of the current
month:
<code>\monthname</code> prints the current month name in full,
e.g. August, and
<code>\shortmonthname</code> prints the abbreviated month name,
e.g. Aug. Both <code>\monthname</code> and
<code>\shortmonthname</code> take an optional argument (a number from
1 to 12) if the name of a specific month is required. For
example, <code>\monthname[6]</code> will produced the output: June.
<P>
The day of the week is computed using the algorithm documented at
<TT><A NAME="tex2html5"
HREF="http://userpages.wittenburg.edu/bshelburne/Comp150/DayOfWeek.htm">http://userpages.wittenburg.edu/bshelburne/Comp150/DayOfWeek.htm</A></TT>.
This algorithm works for any date between 1<SUP>st</SUP>
Jan, 1901 and 31<SUP>st</SUP> Dec, 2099.
The following macros display the day of week for a given date:
<P>
<TT>\dayofweekname{</TT><EM>day</EM><TT>}{</TT><EM>month</EM><TT>}{</TT><EM>year</EM><TT>}</TT> prints the
day of week for the specified date. For example,
<code>\dayofweekname{31}{10}{2002}</code>
will produce the output: Thursday.
<BR>
<TT>\shortdayofweekname</TT><I>day</I><TT>{</TT><EM>month</EM><TT>}{</TT><EM>year</EM><TT>}</TT> prints the
abbreviated name for the
day of week for the specified date. For example
<BR> <code>\shortdayofweekname{31}{10}{2002}</code>
<BR>
will produce the output: Thu.
<P>
The TeX conditional <code>\ifshowdow</code> can be used to determine
whether or not the option <TT>dayofweek</TT> has been passed to
the package.
For example:
<PRE>
\ifshowdow\dayofweekname{31}{10}{2002} \fi
</PRE>
will only display the day of week if the <TT>dayofweek</TT>
option was passed to <TT>datetime</TT>.
Alternatively, you can use David Carlisle's <TT>ifthen</TT>
package:
<PRE>
\ifthenelse{\boolean{showdow}}{\dayofweekname{31}{10}{2002} }{}
</PRE>
<P>
The command <TT>\ordinaldate{</TT><EM>number</EM><TT>}</TT>
displays <I>number</I> as a date-type ordinal. If the
current language is English, this will simply pass
the argument to <TT>\ordinalnum</TT> (defined in the
<TT>fmtcount</TT> package),
if the current language is Breton, Welsh or French, a superscript
will only be added if <I>number</I> is 1, otherwise only
<I>number</I> will be displayed.
<P>
The macro
<TT>\formatdate{</TT><EM>day</EM><TT>}{</TT><EM>month</EM><TT>}{</TT><EM>year</EM><TT>}</TT><A NAME="tex2html6"
HREF="#foot417"><SUP>4</SUP></A> formats the specified date according to
the current format of <TT>\today</TT><A NAME="tex2html7"
HREF="#foot421"><SUP>5</SUP></A>.
(Arguments must all be integers.) For example, in combination with
<code>\longdate</code>, the command
<PRE>
\formatdate{27}{9}{2004}
</PRE>
will produce the output: Monday 27<SUP>th</SUP> September,
2004.
<P>
You can ensure that a number is displayed with at least two
digits by using the command
<TT>\twodigit{</TT><EM>num</EM><TT>}</TT>.
This is of use if you want to define your own date or time
formats.
<P>
<H1><A NAME="SECTION00060000000000000000"></A><A NAME="sec:newdate"></A>
<BR>
Defining New Date Formats
</H1>
<P>
New date formats can be defined using the command:
<BR>
<BR> <TT>\newdateformat{</TT><EM>name</EM><TT>}{</TT><EM>format</EM><TT>}</TT>
<BR>
<BR>
where <I>name</I> is the name of the new format, and
<I>format</I> is how to format the date. Within the
argument <I>format</I> you can use the commands <TT>\THEDAY</TT>,
<TT>\THEMONTH</TT>
and <TT>\THEYEAR</TT> to represent the relevant day, month and
year, or you can use the counters
<TT>DAY</TT>, <TT>MONTH</TT> and <TT>YEAR</TT> if you want to
use <TT>\ordinal</TT> etc. Once you have defined the
new date format, you can then switch to it using the declaration
<code>\</code><I>name</I>
(i.e. the name you specified preceded by a backslash), and
subsequent calls to <TT>\today</TT> and <TT>\formatdate</TT> will
use your new format.
<P>
For example, suppose you want to define a new date format called,
say, <TT>mydate</TT>, that will typeset the date in the form:
8-3-2002,
then you can do:
<PRE>
\newdateformat{mydate}{\THEDAY-\THEMONTH-\THEYEAR}
</PRE>
<TT>\newdateformat</TT> will then define the declaration
<TT>\mydate</TT> 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:
<PRE>
\newdateformat{dashdate}{%
\twodigit{\THEDAY}-\twodigit{\THEMONTH}-\THEYEAR}
\newdateformat{usvardate}{%
\monthname[\THEMONTH] \ordinal{DAY}, \THEYEAR}
Dash: \dashdate\today.
US: \usvardate\today.
</PRE>
If the current date is, say, 8th March, 2002, the above code will
produce the following:
Dash: 08-03-2002.
US: March 8<SUP>th</SUP>, 2002.
<P>
Note that <TT>\THEDAY</TT> etc and <TT>DAY</TT> etc have no real
meaning outside <TT>\newdateformat</TT> (this is why they
are in uppercase). Incidentally, the <TT>dashdate</TT> format
is not really necessary, as you can achieve this format
using:
<PRE>
\renewcommand{\dateseparator}{-}
\ddmmyyyydate
</PRE>
<P>
Another note: in the above code, <TT>\ordinal</TT> was
used to illustrate the use of the <TT>DAY</TT> counter. It
is better to use <TT>\ordinaldate</TT> instead:
<PRE>
\newdateformat{usvardate}{%
\monthname[\THEMONTH] \ordinaldate{\THEDAY}, \THEYEAR}
</PRE>
<P>
<H1><A NAME="SECTION00070000000000000000">
Saving Dates</A>
</H1>
<P>
It is possible to save a date for later use using the command:
<A NAME="tex2html8"
HREF="#foot244"><SUP>6</SUP></A>
<P>
<TT>\newdate{</TT><EM>name</EM><TT>}{</TT><EM>day</EM><TT>}{</TT><EM>month</EM><TT>}{</TT><EM>year</EM><TT>}</TT>
<P>
This date can later be displayed using the same format as that
used by <TT>\formatdate</TT> using the command:
<P>
<TT>\displaydate{</TT><EM>name</EM><TT>}</TT>
<P>
Individual elements of the date can be extracted using the
commands:
<P>
<TT>\getdateday{</TT><EM>name</EM><TT>}</TT>
<P>
<TT>\getdatemonth{</TT><EM>name</EM><TT>}</TT>
<P>
<TT>\getdateyear{</TT><EM>name</EM><TT>}</TT>
<P>
<H1><A NAME="SECTION00080000000000000000">
Predefined Names</A>
</H1>
<P>
The following commands are defined by the <TT>datetime</TT>
package:
<P>
<TABLE CELLPADDING=3>
<TR><TH ALIGN="LEFT"><B>Command Name </B></TH>
<TH ALIGN="LEFT"><B>Default Value</B></TH>
</TR>
<TR><TD ALIGN="LEFT"><TT>\dateseparator</TT></TD>
<TD ALIGN="LEFT"><code>/</code></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>\timeseparator</TT></TD>
<TD ALIGN="LEFT"><code>:</code></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>\amname</TT></TD>
<TD ALIGN="LEFT"><TT>am</TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>\pmname</TT></TD>
<TD ALIGN="LEFT"><TT>pm</TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>\amorpmname</TT></TD>
<TD ALIGN="LEFT"><TT>\amname</TT> if morning, otherwise <TT>\pmname</TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>\amstring</TT></TD>
<TD ALIGN="LEFT"><TT>in the morning</TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>\pmstring</TT></TD>
<TD ALIGN="LEFT"><TT>in the afternoon</TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>\amorpmstring</TT></TD>
<TD ALIGN="LEFT"><TT>\amstring</TT> if morning, otherwise
<TT>\pmstring</TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>\halfpast</TT></TD>
<TD ALIGN="LEFT"><TT>Half past</TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>\quarterpast</TT></TD>
<TD ALIGN="LEFT"><TT>Quarter past</TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>\quarterto</TT></TD>
<TD ALIGN="LEFT"><TT>Quarter to</TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>\noon</TT></TD>
<TD ALIGN="LEFT"><TT>Noon</TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>\midnight</TT></TD>
<TD ALIGN="LEFT"><TT>Midnight</TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>\oclockstring</TT></TD>
<TD ALIGN="LEFT"><TT>O'Clock</TT></TD>
</TR>
</TABLE>
<P>
<H1><A NAME="SECTION00090000000000000000">
Package Options</A>
</H1>
<P>
The following options may be passed to this package:
<BR>
<BR> <TABLE CELLPADDING=3>
<TR><TD ALIGN="LEFT"><TT></TD><TD ALIGN="LEFT">long </TT></TD>
<TD ALIGN="LEFT">make <TT>\today</TT> produce long date</TD>
</TR>
<TR><TD ALIGN="LEFT"><TT></TD><TD ALIGN="LEFT">short </TT></TD>
<TD ALIGN="LEFT">make <TT>\today</TT> produce short date</TD>
</TR>
<TR><TD ALIGN="LEFT"><TT></TD><TD ALIGN="LEFT">ddmmyyyy </TT></TD>
<TD ALIGN="LEFT">make <TT>\today</TT> produce DD/MM/YYYY date</TD>
</TR>
<TR><TD ALIGN="LEFT"><TT></TD><TD ALIGN="LEFT">dmyyyy </TT></TD>
<TD ALIGN="LEFT">make <TT>\today</TT> produce D/M/YYYY date</TD>
</TR>
<TR><TD ALIGN="LEFT"><TT></TD><TD ALIGN="LEFT">ddmmyy </TT></TD>
<TD ALIGN="LEFT">make <TT>\today</TT> produce DD/MM/YY date</TD>
</TR>
<TR><TD ALIGN="LEFT"><TT></TD><TD ALIGN="LEFT">dmyy </TT></TD>
<TD ALIGN="LEFT">make <TT>\today</TT> produce D/M/YY date</TD>
</TR>
<TR><TD ALIGN="LEFT"><TT></TD><TD ALIGN="LEFT">text </TT></TD>
<TD ALIGN="LEFT">make <TT>\today</TT> produce text date</TD>
</TR>
<TR><TD ALIGN="LEFT"><TT></TD><TD ALIGN="LEFT">us </TT></TD>
<TD ALIGN="LEFT">make <TT>\today</TT> produce US style date</TD>
</TR>
<TR><TD ALIGN="LEFT"><TT></TD><TD ALIGN="LEFT">mmddyyyy </TT></TD>
<TD ALIGN="LEFT">make <TT>\today</TT> produce MM/DD/YYYY date</TD>
</TR>
<TR><TD ALIGN="LEFT"><TT></TD><TD ALIGN="LEFT">mdyyyy </TT></TD>
<TD ALIGN="LEFT">make <TT>\today</TT> produce M/D/YYYY date</TD>
</TR>
<TR><TD ALIGN="LEFT"><TT></TD><TD ALIGN="LEFT">mmddyy </TT></TD>
<TD ALIGN="LEFT">make <TT>\today</TT> produce MM/DD/YY date</TD>
</TR>
<TR><TD ALIGN="LEFT"><TT></TD><TD ALIGN="LEFT">mdyy </TT></TD>
<TD ALIGN="LEFT">make <TT>\today</TT> produce M/D/YY date</TD>
</TR>
<TR><TD ALIGN="LEFT"><TT></TD><TD ALIGN="LEFT">raise </TT></TD>
<TD ALIGN="LEFT">make ordinal st,nd,rd,th appear as superscript</TD>
</TR>
<TR><TD ALIGN="LEFT"><TT></TD><TD ALIGN="LEFT">level </TT></TD>
<TD ALIGN="LEFT">make ordinal st,nd,rd,th appear level with rest of
text</TD>
</TR>
<TR><TD ALIGN="LEFT"><TT></TD><TD ALIGN="LEFT">dayofweek </TT></TD>
<TD ALIGN="LEFT">make the day of week appear for <TT>\longdate</TT>,
<TT>\shortdate</TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT></TD><TD ALIGN="LEFT"></TT></TD>
<TD ALIGN="LEFT">or <TT>\textdate</TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT></TD><TD ALIGN="LEFT">nodayofweek </TT></TD>
<TD ALIGN="LEFT">don't display the day of week.</TD>
</TR>
<TR><TD ALIGN="LEFT"><TT></TD><TD ALIGN="LEFT">24hr </TT></TD>
<TD ALIGN="LEFT">make <TT>\currenttime</TT> produce <TT>xxivtime</TT>
format</TD>
</TR>
<TR><TD ALIGN="LEFT"><TT></TD><TD ALIGN="LEFT">12hr </TT></TD>
<TD ALIGN="LEFT">make <TT>\currenttime</TT> produce <TT>ampmtime</TT>
format</TD>
</TR>
<TR><TD ALIGN="LEFT"><TT></TD><TD ALIGN="LEFT">oclock </TT></TD>
<TD ALIGN="LEFT">make <TT>\currenttime</TT> produce <TT>oclock</TT>
format</TD>
</TR>
<TR><TD ALIGN="LEFT"><TT></TD><TD ALIGN="LEFT">nodate </TT></TD>
<TD ALIGN="LEFT">Don't redefine <TT>\today</TT> or define the month or
day of week commands</TD>
</TR>
<TR><TD ALIGN="LEFT"><TT></TD><TD ALIGN="LEFT"></TT></TD>
<TD ALIGN="LEFT">(useful if you only want the time commands or
<code>\pdfdate</code>)</TD>
</TR>
</TABLE>
<P>
The default options are: <TT>long</TT>, <TT>raise</TT>,
<TT>dayofweek</TT> and <TT>24hr</TT>.
<P>
<H1><A NAME="SECTION000100000000000000000">
Multilingual Support</A>
</H1>
<P>
If you want to use the <TT>babel</TT> package, you must load
it <I>before</I> you load the <TT>datetime</TT> package. This
is because the <TT>babel</TT> <TT>\date</TT><I>lang</I> commands
redefine <TT>\today</TT>, whereas the <TT>datetime</TT> package
redefines <TT>\today</TT> to use <TT>\formatdate</TT>, and the
date formatting commands (such as <TT>\longdate</TT>) redefine
<TT>\formatdate</TT> rather than <TT>\today</TT>. This ensures
consistent formatting of the dates whether you use <TT>\today</TT> or
<TT>\formatdate</TT>. Therefore, the <TT>datetime</TT> package
has to redefine all the <TT>\date</TT><I>lang</I> commands accordingly.
Thus the multilingual date support is mostly limited to that provided
by <TT>babel</TT>. 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.
<P>
The commands <TT>\monthname</TT> and <TT>\shortmonthname</TT>,
will produce the month name in the current language.
If you want the month name in a specific language, you
can use the command <TT>\monthname</TT><I>lang</I>.
For example, <code>\monthnamefrench[6]</code> will produce the output:
juin. Note that <TT>\textdate</TT> is formatted for English dates,
and won't look right if used with another language setting. If you
want a textual date, the <TT>fmtcount</TT> package (which is
loaded by <TT>datetime</TT>) defines some commands which display
a number or ordinal as a word, but it only has very limited
multilingual support. See the <TT>fmtcount</TT> documentation
for further details.
<P>
There is currently only <I>limited</I> multilingual support for
<TT>\dayofweekname</TT> and <TT>\shortdayofweekname</TT> (just
English, French, Portuguese, Spanish and German<A NAME="tex2html9"
HREF="#foot358"><SUP>7</SUP></A>). You can add support
for other languages by defining the commands
<TT>\dayofweeknameid</TT><I>lang</I> and
<TT>\shortdayofweeknameid</TT><I>lang</I>. Note that these
commands only take <I>one</I> argument which should be
a number from 1 to 7 indicating the day of the week.
<P>
You can use the following as templates. Replace
<TT>english</TT> with the name of your language (as given
by <TT>\languagename</TT>) and replace <TT>Sunday</TT>
etc as appropriate:
<PRE>
\providecommand*{\dayofweeknameidenglish}[1]{%
\ifcase#1\relax
\or Sunday%
\or Monday%
\or Tuesday%
\or Wednesday%
\or Thursday%
\or Friday%
\or Saturday%
\fi}
\providecommand*{\shortdayofweeknameidenglish}[1]{%
\ifcase#1\relax
\or Sun%
\or Mon%
\or Tue%
\or Wed%
\or Thu%
\or Fri%
\or Sat%
\fi}
</PRE>
If you want them added to future versions of
<TT>datetime</TT>, please email me the code.
<P>
<H1><A NAME="SECTION000110000000000000000">
Configuration File</A>
</H1>
<P>
As from Version 2.4, the <TT>datetime</TT> package will read in settings
from the configuration file <TT>datetime.cfg</TT>, 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 <TT>datetime.cfg</TT> that
contains the line:
<PRE>
\shortdate\showdowfalse
</PRE>
The file <TT>datetime.cfg</TT> should then go somewhere on the
TeX path. Now all you need to do is:
<PRE>
\usepackage{datetime}
</PRE>
without having to specify the <TT>short</TT> and
<TT>nodayofweek</TT> options.
<P>
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:
<PRE>
\newdateformat{dashdate}{\twodigit{\THEDAY}-\twodigit{\THEMONTH}-\THEYEAR}
\dashdate
</PRE>
Whenever you use the <TT>datetime</TT> package, it will now
use this format by default.
<P>
<H1><A NAME="SECTION000120000000000000000">
LaTeX2HTML styles</A>
</H1>
<P>
Version 2.43 and above of the <TT>datetime</TT> bundle
supplies the LaTeX2HTML style file <TT>datetime.perl</TT>.
This file should be placed in a
directory searched by LaTeX2HTML. The following limitations
apply to the LaTeX2HTML styles:
<P>
<UL>
<LI>The configuration file <TT>datetime.cfg</TT>
is currently ignored. (This is because
I can't work out the correct code to do this. If you
know how to do this, please let me know.) You can however
do:
<PRE>
\usepackage{datetime}
\html{\input{datetime.cfg}}
</PRE>
This, I agree, is an unpleasant cludge.
<P>
</LI>
<LI>The commands <TT>\monthname</TT><I>language</I> are not
implemented.
<P>
</LI>
<LI>Some of the languages are not implemented.
<P>
</LI>
<LI>The package option <TT>nodate</TT> is not implemented.
<P>
</LI>
</UL>
<P>
<H1><A NAME="SECTION000130000000000000000">
Troubleshooting</A>
</H1>
<P>
There is a <TT>datetime</TT> FAQ available at:
<TT><A NAME="tex2html10"
HREF="http://theoval.cmp.uea.ac.uk/~nlct/latex/packages/faq/">http://theoval.cmp.uea.ac.uk/~nlct/latex/packages/faq/</A></TT>
<P>
<BR><HR><H4>Footnotes</H4>
<DL>
<DT><A NAME="foot411">...
selected</A><A
HREF="manual.html#tex2html2"><SUP>1</SUP></A></DT>
<DD>in fact, you may get an error from the
<TT>fmtcount</TT> package if you are using a language that it
doesn't support.
</DD>
<DT><A NAME="foot416">...
format</A><A
HREF="manual.html#tex2html3"><SUP>2</SUP></A></DT>
<DD>Note that the commands <TT>\xxivtime</TT>, <TT>\ampmtime</TT>
and <TT>\oclock</TT> are still available, <TT>\settimeformat</TT> redefines
<TT>\currenttime</TT> to the command given by placing a backslash in front
of <I>style</I>. So <TT>\settimeformat{xxivtime}</TT> sets
<TT>\currenttime</TT> to <TT>\xxivtime</TT> and so on.
</DD>
<DT><A NAME="foot148">... <code>\pdfdate</code></A><A
HREF="manual.html#tex2html4"><SUP>3</SUP></A></DT>
<DD>thanks to Ulrich Dirr for
asking about this
</DD>
<DT><A NAME="foot417">...year</A><A
HREF="manual.html#tex2html6"><SUP>4</SUP></A></DT>
<DD>Note the
name change since version 1.1. The command name was changed from
<TT>\thedate</TT> to <TT>\formatdate</TT> to avoid a name clash when using the
<TT>seminar</TT> class file.
</DD>
<DT><A NAME="foot421">...today</A><A
HREF="manual.html#tex2html7"><SUP>5</SUP></A></DT>
<DD>To be more precise,
<TT>\today</TT> is defined to be
<TT>\formatdate{<TT>\day</TT>}{<TT>\month</TT>}{<TT>\year</TT>}</TT> where
<TT>\longdate</TT> etc change the definition of <TT>\formatdate</TT>
</DD>
<DT><A NAME="foot244">... command:</A><A
HREF="manual.html#tex2html8"><SUP>6</SUP></A></DT>
<DD>Thanks to Denis Bitouzé for asking about this
</DD>
<DT><A NAME="foot358">... German</A><A
HREF="manual.html#tex2html9"><SUP>7</SUP></A></DT>
<DD>thanks
to Uwe Bieling for supplying the German names
</DD>
</DL>
<BR><HR>
<ADDRESS>
<A href=http://theoval.cmp.uea.ac.uk/~nlct/>Nicola L. C. Talbot</A>.
<A HREF=http://www.cmp.uea.ac.uk/>School of Computing Sciences</A>.
<A HREF=http://www.uea.ac.uk/>University of East Anglia.</A>
Last Modified: 2007-08-20
</ADDRESS>
</BODY>
</HTML>
|