1 | %% |
---|
2 | %% This is file `datetime.sty', |
---|
3 | %% generated with the docstrip utility. |
---|
4 | %% |
---|
5 | %% The original source files were: |
---|
6 | %% |
---|
7 | %% datetime.dtx (with options: `datetime.sty,package') |
---|
8 | %% Copyright (C) 2005 Nicola Talbot, all rights reserved. |
---|
9 | %% If you modify this file, you must change its name first. |
---|
10 | %% You are NOT ALLOWED to distribute this file alone. You are NOT |
---|
11 | %% ALLOWED to take money for the distribution or use of either this |
---|
12 | %% file or a changed version, except for a nominal charge for copying |
---|
13 | %% etc. |
---|
14 | %% \CharacterTable |
---|
15 | %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z |
---|
16 | %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z |
---|
17 | %% Digits \0\1\2\3\4\5\6\7\8\9 |
---|
18 | %% Exclamation \! Double quote \" Hash (number) \# |
---|
19 | %% Dollar \$ Percent \% Ampersand \& |
---|
20 | %% Acute accent \' Left paren \( Right paren \) |
---|
21 | %% Asterisk \* Plus \+ Comma \, |
---|
22 | %% Minus \- Point \. Solidus \/ |
---|
23 | %% Colon \: Semicolon \; Less than \< |
---|
24 | %% Equals \= Greater than \> Question mark \? |
---|
25 | %% Commercial at \@ Left bracket \[ Backslash \\ |
---|
26 | %% Right bracket \] Circumflex \^ Underscore \_ |
---|
27 | %% Grave accent \` Left brace \{ Vertical bar \| |
---|
28 | %% Right brace \} Tilde \~} |
---|
29 | \NeedsTeXFormat{LaTeX2e} |
---|
30 | \ProvidesPackage{datetime}[2005/09/30 v2.46 Date Time Package] |
---|
31 | \RequirePackage{fmtcount} |
---|
32 | \newif\if@dt@nodate |
---|
33 | \@dt@nodatefalse |
---|
34 | \newcommand{\dateseparator}{/} |
---|
35 | \newcommand{\ordinaldateenglish}[1]{\ordinalnum{#1}} |
---|
36 | \let\ordinaldatenohyphenation=\ordinaldateenglish |
---|
37 | |
---|
38 | \newcommand{\ordinaldatewelsh}[1]{% |
---|
39 | #1\ifnum#1=1\/\textsuperscript{a\~n}\fi} |
---|
40 | |
---|
41 | \newcommand{\ordinaldatebreton}[1]{% |
---|
42 | #1\ifnum#1=1\/\textsuperscript{a\~n}\fi} |
---|
43 | |
---|
44 | \newcommand{\ordinaldatefrench}[1]{% |
---|
45 | #1\ifnum#1=1\ier\fi} |
---|
46 | |
---|
47 | \newcommand{\ordinaldate}[1]{% |
---|
48 | \@ifundefined{languagename}{\ordinalnum{#1}}{% |
---|
49 | \@ifundefined{ordinaldate\languagename}{#1}{% |
---|
50 | \csname ordinaldate\languagename\endcsname{#1}}}} |
---|
51 | \newif\ifshowdow % show the day of week if true |
---|
52 | |
---|
53 | \providecommand{\formatdate}[3]{} |
---|
54 | |
---|
55 | \newcount\@day |
---|
56 | \newcount\@month |
---|
57 | \newcount\@year |
---|
58 | |
---|
59 | \DeclareRobustCommand*{\longdate}{% |
---|
60 | \renewcommand{\formatdate}[3]{\ifshowdow\dayofweekname{##1}{##2}{##3} \fi |
---|
61 | \@day=##1\relax\@month=##2\relax\@year=##3\relax |
---|
62 | \ordinaldate{\the\@day}\ \monthname[\@month], \the\@year}} |
---|
63 | |
---|
64 | \DeclareRobustCommand*{\shortdate}{% |
---|
65 | \renewcommand{\formatdate}[3]{\ifshowdow\shortdayofweekname{##1}{##2}{##3} \fi |
---|
66 | \@day=##1\relax\@month=##2\relax\@year=##3\relax |
---|
67 | \ordinaldate{\the\@day}\ \shortmonthname[\@month], \the\@year}} |
---|
68 | |
---|
69 | \providecommand*{\twodigit}[1]{{\@dtctr=#1\relax\ifnum\@dtctr<10 0\fi\the\@dtctr}} |
---|
70 | |
---|
71 | \DeclareRobustCommand*{\ddmmyyyydate}{% |
---|
72 | \renewcommand{\formatdate}[3]{\@day=##1\relax\@month=##2\relax\@year=##3\relax |
---|
73 | \twodigit\@day\dateseparator \twodigit\@month\dateseparator \the\@year}} |
---|
74 | |
---|
75 | \DeclareRobustCommand*{\dmyyyydate}{% |
---|
76 | \renewcommand{\formatdate}[3]{\@day=##1\relax\@month=##2\relax\@year=##3\relax |
---|
77 | \the\@day\dateseparator \the\@month\dateseparator \the\@year}} |
---|
78 | |
---|
79 | \DeclareRobustCommand*{\ddmmyydate}{\renewcommand{\formatdate}[3]{% |
---|
80 | \@day=##1\relax\@month=##2\relax\@year=##3\relax |
---|
81 | \@dtctr=\@year% |
---|
82 | \@modulo{\@dtctr}{100}% |
---|
83 | \twodigit\@day\dateseparator \twodigit\@month\dateseparator \twodigit\@dtctr}} |
---|
84 | |
---|
85 | \DeclareRobustCommand*{\dmyydate}{\renewcommand{\formatdate}[3]{% |
---|
86 | \@day=##1\relax\@month=##2\relax\@year=##3\relax |
---|
87 | \@dtctr=\@year% |
---|
88 | \@modulo{\@dtctr}{100}% |
---|
89 | \the\@day\dateseparator \the\@month\dateseparator \twodigit\@dtctr}} |
---|
90 | |
---|
91 | \DeclareRobustCommand*{\textdate}{% |
---|
92 | \renewcommand{\formatdate}[3]{\ifshowdow\dayofweekname{##1}{##2}{##3} the \fi |
---|
93 | \@day=##1\relax\@month=##2\relax\@year=##3\relax |
---|
94 | \@Ordinalstring\@day\ of \monthname[\@month], \@Numberstring\@year}} |
---|
95 | |
---|
96 | \DeclareRobustCommand*{\usdate}{% |
---|
97 | \renewcommand{\formatdate}[3]{\@day=##1\relax\@month=##2\relax\@year=##3\relax |
---|
98 | \monthname[\@month]\ \the\@day, \the\@year}} |
---|
99 | |
---|
100 | \DeclareRobustCommand*{\mmddyyyydate}{% |
---|
101 | \renewcommand{\formatdate}[3]{\@day=##1\relax\@month=##2\relax\@year=##3\relax |
---|
102 | \twodigit\@month\dateseparator \twodigit\@day\dateseparator \the\@year}} |
---|
103 | |
---|
104 | \DeclareRobustCommand*{\mdyyyydate}{% |
---|
105 | \renewcommand{\formatdate}[3]{\@day=##1\relax\@month=##2\relax\@year=##3\relax |
---|
106 | \the\@month\dateseparator \the\@day\dateseparator \the\@year}} |
---|
107 | |
---|
108 | \DeclareRobustCommand*{\mmddyydate}{\renewcommand{\formatdate}[3]{% |
---|
109 | \@day=##1\relax\@month=##2\relax\@year=##3\relax |
---|
110 | \@dtctr=\@year% |
---|
111 | \@modulo{\@dtctr}{100}% |
---|
112 | \twodigit\@month\dateseparator \twodigit\@day\dateseparator \twodigit\@dtctr}} |
---|
113 | |
---|
114 | \DeclareRobustCommand*{\mdyydate}{\renewcommand{\formatdate}[3]{% |
---|
115 | \@day=##1\relax\@month=##2\relax\@year=##3\relax |
---|
116 | \@dtctr=\@year% |
---|
117 | \@modulo{\@dtctr}{100}% |
---|
118 | \the\@month\dateseparator \the\@day\dateseparator \twodigit\@dtctr}} |
---|
119 | \newcommand{\newdate}[4]{% |
---|
120 | \@ifundefined{date@#1@y}{% |
---|
121 | \@namedef{date@#1@d}{#2}% |
---|
122 | \@namedef{date@#1@m}{#3}% |
---|
123 | \@namedef{date@#1@y}{#4}}{% |
---|
124 | \PackageError{datetime}{Date `#1' already defined}{}}} |
---|
125 | |
---|
126 | \newcommand{\getdateyear}[1]{% |
---|
127 | \@ifundefined{date@#1@y}{% |
---|
128 | \PackageError{datetime}{Date `#1' not defined}{}}{% |
---|
129 | \csname date@#1@y\endcsname}} |
---|
130 | |
---|
131 | \newcommand{\getdatemonth}[1]{% |
---|
132 | \@ifundefined{date@#1@m}{% |
---|
133 | \PackageError{datetime}{Date `#1' not defined}{}}{% |
---|
134 | \csname date@#1@m\endcsname}} |
---|
135 | |
---|
136 | \newcommand{\getdateday}[1]{% |
---|
137 | \@ifundefined{date@#1@d}{% |
---|
138 | \PackageError{datetime}{Date `#1' not defined}{}}{% |
---|
139 | \csname date@#1@d\endcsname}} |
---|
140 | |
---|
141 | \newcommand{\displaydate}[1]{% |
---|
142 | \@ifundefined{date@#1@y}{% |
---|
143 | \PackageError{datetime}{Date `#1' not defined}{}}{% |
---|
144 | \formatdate{\csname date@#1@d\endcsname}{% |
---|
145 | \csname date@#1@m\endcsname}{% |
---|
146 | \csname date@#1@y\endcsname}}} |
---|
147 | \DeclareRobustCommand*{\currenttime}{\xxivtime} |
---|
148 | |
---|
149 | \newcommand{\timeseparator}{:} |
---|
150 | |
---|
151 | \providecommand{\settimeformat}[1]{\DeclareRobustCommand*\currenttime{\csname#1\endcsname}} |
---|
152 | \longdate |
---|
153 | \showdowtrue |
---|
154 | \InputIfFileExists{datetime.cfg}{\typeout{Loading local datetime configurations}}{\typeout{No datetime.cfg file found}} |
---|
155 | \RequirePackage{fmtcount} |
---|
156 | \DeclareOption{long}{\longdate} |
---|
157 | \DeclareOption{short}{\shortdate} |
---|
158 | \DeclareOption{ddmmyyyy}{\ddmmyyyydate} |
---|
159 | \DeclareOption{dmyyyy}{\dmyyyydate} |
---|
160 | \DeclareOption{ddmmyy}{\ddmmyydate} |
---|
161 | \DeclareOption{dmyy}{\dmyydate} |
---|
162 | \DeclareOption{text}{\textdate} |
---|
163 | \DeclareOption{us}{\usdate} |
---|
164 | \DeclareOption{mmddyyyy}{\mmddyyyydate} |
---|
165 | \DeclareOption{mdyyyy}{\mdyyyydate} |
---|
166 | \DeclareOption{mmddyy}{\mmddyydate} |
---|
167 | \DeclareOption{mdyy}{\mdyydate} |
---|
168 | \DeclareOption{level}{\fmtcountsetoptions{fmtord=level}} |
---|
169 | \DeclareOption{raise}{\fmtcountsetoptions{fmtord=raise}} |
---|
170 | \DeclareOption{dayofweek}{\showdowtrue} |
---|
171 | \DeclareOption{nodayofweek}{\showdowfalse} |
---|
172 | \DeclareOption{nodate}{\@dt@nodatetrue} |
---|
173 | \DeclareOption{24hr}{\settimeformat{xxivtime}} |
---|
174 | \DeclareOption{12hr}{\settimeformat{ampmtime}} |
---|
175 | \DeclareOption{oclock}{\settimeformat{oclock}} |
---|
176 | |
---|
177 | |
---|
178 | \DeclareOption{austrian}{\input{dt-austrian.def}} |
---|
179 | \DeclareOption{bahasa}{\input{dt-bahasa.def}} |
---|
180 | \DeclareOption{basque}{\input{dt-basque.def}} |
---|
181 | \DeclareOption{breton}{\input{dt-breton.def}} |
---|
182 | \DeclareOption{bulgarian}{\input{dt-bulgarian.def}} |
---|
183 | \DeclareOption{catalan}{\input{dt-catalan.def}} |
---|
184 | \DeclareOption{croatian}{\input{dt-croatian.def}} |
---|
185 | \DeclareOption{czech}{\input{dt-czech.def}} |
---|
186 | \DeclareOption{danish}{\input{dt-danish.def}} |
---|
187 | \DeclareOption{dutch}{\input{dt-dutch.def}} |
---|
188 | \DeclareOption{esperanto}{\input{dt-esperanto.def}} |
---|
189 | \DeclareOption{estonian}{\input{dt-estonian.def}} |
---|
190 | \DeclareOption{finnish}{\input{dt-finnish.def}} |
---|
191 | \DeclareOption{french}{\input{dt-french.def}} |
---|
192 | \DeclareOption{galician}{\input{dt-galician.def}} |
---|
193 | \DeclareOption{german}{\input{dt-german.def}} |
---|
194 | \DeclareOption{greek}{\input{dt-greek.def}} |
---|
195 | \DeclareOption{hebrew}{\input{dt-hebrew.def}} |
---|
196 | \DeclareOption{icelandic}{\input{dt-icelandic.def}} |
---|
197 | \DeclareOption{irish}{\input{dt-irish.def}} |
---|
198 | \DeclareOption{italian}{\input{dt-italian.def}} |
---|
199 | \DeclareOption{latin}{\input{dt-latin.def}} |
---|
200 | \DeclareOption{lsorbian}{\input{dt-lsorbian.def}} |
---|
201 | \DeclareOption{magyar}{\input{dt-magyar.def}} |
---|
202 | \DeclareOption{naustrian}{\input{dt-naustrian.def}} |
---|
203 | \DeclareOption{ngerman}{\input{dt-ngerman.def}} |
---|
204 | \DeclareOption{norsk}{\input{dt-norsk.def}} |
---|
205 | \DeclareOption{polish}{\input{dt-polish.def}} |
---|
206 | \DeclareOption{portuges}{\input{dt-portuges.def}} |
---|
207 | \DeclareOption{romanian}{\input{dt-romanian.def}} |
---|
208 | \DeclareOption{russian}{\input{dt-russian.def}} |
---|
209 | \DeclareOption{samin}{\input{dt-samin.def}} |
---|
210 | \DeclareOption{scottish}{\input{dt-scottish.def}} |
---|
211 | \DeclareOption{serbian}{\input{dt-serbian.def}} |
---|
212 | \DeclareOption{slovak}{\input{dt-slovak.def}} |
---|
213 | \DeclareOption{slovene}{\input{dt-slovene.def}} |
---|
214 | \DeclareOption{spanish}{\input{dt-spanish.def}} |
---|
215 | \DeclareOption{swedish}{\input{dt-swedish.def}} |
---|
216 | \DeclareOption{turkish}{\input{dt-turkish.def}} |
---|
217 | \DeclareOption{ukraineb}{\input{dt-ukraineb.def}} |
---|
218 | \DeclareOption{usorbian}{\input{dt-usorbian.def}} |
---|
219 | \DeclareOption{welsh}{\input{dt-welsh.def}} |
---|
220 | |
---|
221 | \ProcessOptions |
---|
222 | \RequirePackage{ifthen} |
---|
223 | \if@dt@nodate |
---|
224 | \typeout{datetime package message : option "nodate" used, so not defining \protect\monthname} |
---|
225 | \else |
---|
226 | \providecommand{\monthnameenglish}[1][\month]{% |
---|
227 | \@orgargctr=#1\relax |
---|
228 | \ifcase\@orgargctr |
---|
229 | \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (January) to 12 (December)}% |
---|
230 | \or January% |
---|
231 | \or February% |
---|
232 | \or March% |
---|
233 | \or April% |
---|
234 | \or May% |
---|
235 | \or June% |
---|
236 | \or July% |
---|
237 | \or August% |
---|
238 | \or September% |
---|
239 | \or October% |
---|
240 | \or November% |
---|
241 | \or December% |
---|
242 | \else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (January) to 12 (December)}% |
---|
243 | \fi} |
---|
244 | |
---|
245 | %\let\monthname=\monthnameenglish |
---|
246 | \newcommand{\monthname}{\@ifundefined{languagename}{% |
---|
247 | \monthnameenglish}{\@ifundefined{monthname\languagename}{% |
---|
248 | \monthnameenglish}{\csname monthname\languagename\endcsname}}} |
---|
249 | \fi |
---|
250 | \if@dt@nodate |
---|
251 | \typeout{datetime package message : option "nodate" used, so not defining \protect\shortmonthname} |
---|
252 | \else |
---|
253 | \providecommand{\shortmonthnameenglish}[1][\month]{% |
---|
254 | \@orgargctr=#1\relax |
---|
255 | \ifcase\@orgargctr |
---|
256 | \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (jan) to 12 (dec)}% |
---|
257 | \or Jan% |
---|
258 | \or Feb% |
---|
259 | \or Mar% |
---|
260 | \or Apr% |
---|
261 | \or May% |
---|
262 | \or Jun% |
---|
263 | \or Jul% |
---|
264 | \or Aug% |
---|
265 | \or Sept% |
---|
266 | \or Oct% |
---|
267 | \or Nov% |
---|
268 | \or Dec% |
---|
269 | \else% |
---|
270 | \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (jan) to 12 (dec)}% |
---|
271 | \fi} |
---|
272 | |
---|
273 | %\let\shortmonthname=\shortmonthnameenglish |
---|
274 | |
---|
275 | \newcommand{\shortmonthname}{\@ifundefined{languagename}{% |
---|
276 | \shortmonthnameenglish}{\@ifundefined{shortmonthname\languagename}{% |
---|
277 | \shortmonthnameenglish}{\csname shortmonthname\languagename\endcsname}}} |
---|
278 | \fi |
---|
279 | \newif\ifleapyear |
---|
280 | |
---|
281 | \newcount\@dtctr |
---|
282 | |
---|
283 | \if@dt@nodate |
---|
284 | \typeout{datetime package message : option "nodate" used, so not defining \protect\dayofweek \space or \protect\shortdayofweek} |
---|
285 | \else |
---|
286 | |
---|
287 | \providecommand{\testifleapyear}[1]{% |
---|
288 | \leapyearfalse |
---|
289 | \@year=#1\relax |
---|
290 | \@dtctr=\@year |
---|
291 | \@modulo{\@dtctr}{400}% |
---|
292 | \ifnum\@dtctr=0\relax |
---|
293 | \leapyeartrue % year mod 400 = 0 => leap year |
---|
294 | \else |
---|
295 | \@dtctr=\@year |
---|
296 | \@modulo{\@dtctr}{100}% |
---|
297 | \ifnum\@dtctr=0\relax |
---|
298 | \leapyearfalse % year mod 100 = 0 && year mod 400 != 0 => not a leap year |
---|
299 | \else |
---|
300 | \@dtctr=\@year |
---|
301 | \@modulo{\@dtctr}{4}% |
---|
302 | \ifnum\@dtctr=0\relax |
---|
303 | \leapyeartrue % year mod 4 = 0 && year mod 100 != 0 => leap year |
---|
304 | \fi |
---|
305 | \fi |
---|
306 | \fi |
---|
307 | } |
---|
308 | |
---|
309 | \newcount\dayofyear |
---|
310 | |
---|
311 | |
---|
312 | \providecommand{\computedayofyear}[3]{% |
---|
313 | \testifleapyear{#3}% |
---|
314 | \dayofyear=0\relax |
---|
315 | \@day=#1\relax \@month=#2\relax \@year=#3\relax |
---|
316 | \ifcase\@month |
---|
317 | \or |
---|
318 | \or \advance\dayofyear by 31\relax |
---|
319 | \or \advance\dayofyear by 59\relax |
---|
320 | \or \advance\dayofyear by 90\relax |
---|
321 | \or \advance\dayofyear by 120\relax |
---|
322 | \or \advance\dayofyear by 151\relax |
---|
323 | \or \advance\dayofyear by 181\relax |
---|
324 | \or \advance\dayofyear by 212\relax |
---|
325 | \or \advance\dayofyear by 243\relax |
---|
326 | \or \advance\dayofyear by 273\relax |
---|
327 | \or \advance\dayofyear by 304\relax |
---|
328 | \or \advance\dayofyear by 334\relax |
---|
329 | \else |
---|
330 | \PackageError{datetime}{Invalid month number}{The second argument to \protect\computedayofyear |
---|
331 | should lie in the range 1-12} |
---|
332 | \fi |
---|
333 | \ifnum\@month>2\relax |
---|
334 | \ifleapyear\advance\dayofyear by 1\relax\fi |
---|
335 | \fi |
---|
336 | \advance\dayofyear by \@day\relax |
---|
337 | } |
---|
338 | |
---|
339 | \newcount\dayofweek |
---|
340 | |
---|
341 | |
---|
342 | \providecommand{\computedayofweek}[3]{% |
---|
343 | \computedayofyear{#1}{#2}{#3}% |
---|
344 | \@dtctr=#3\relax |
---|
345 | \advance\@dtctr by -1901\relax |
---|
346 | \@modulo{\@dtctr}{28}% |
---|
347 | \dayofweek=\@dtctr |
---|
348 | \divide\dayofweek by 4\relax |
---|
349 | \advance\dayofweek by \@dtctr |
---|
350 | \advance\dayofweek by 2\relax |
---|
351 | \@modulo{\dayofweek}{7}% |
---|
352 | \advance\dayofweek by \dayofyear |
---|
353 | \advance\dayofweek by -1\relax |
---|
354 | \@modulo{\dayofweek}{7}% |
---|
355 | \advance\dayofweek by 1\relax} |
---|
356 | |
---|
357 | \providecommand{\dayofweeknameidenglish}[1]{% |
---|
358 | \ifcase#1\relax |
---|
359 | \or Sunday% |
---|
360 | \or Monday% |
---|
361 | \or Tuesday% |
---|
362 | \or Wednesday% |
---|
363 | \or Thursday% |
---|
364 | \or Friday% |
---|
365 | \or Saturday% |
---|
366 | \fi} |
---|
367 | |
---|
368 | \providecommand{\dayofweeknameid}[1]{% |
---|
369 | \@ifundefined{languagename}{% |
---|
370 | \dayofweeknameidenglish{#1}}{% |
---|
371 | \@ifundefined{dayofweeknameid\languagename}{% |
---|
372 | \dayofweeknameidenglish{#1}}{% |
---|
373 | \csname dayofweeknameid\languagename\endcsname{#1}}}% |
---|
374 | } |
---|
375 | |
---|
376 | \providecommand{\dayofweekname}[3]{% |
---|
377 | \computedayofweek{#1}{#2}{#3}% |
---|
378 | \dayofweeknameid{\dayofweek}% |
---|
379 | } |
---|
380 | |
---|
381 | \providecommand{\thisdayofweekname}{% |
---|
382 | \dayofweekname{\day}{\month}{\year}} |
---|
383 | |
---|
384 | \providecommand{\shortdayofweeknameidenglish}[1]{% |
---|
385 | \ifcase#1\relax |
---|
386 | \or Sun% |
---|
387 | \or Mon% |
---|
388 | \or Tue% |
---|
389 | \or Wed% |
---|
390 | \or Thu% |
---|
391 | \or Fri% |
---|
392 | \or Sat% |
---|
393 | \fi} |
---|
394 | |
---|
395 | \providecommand{\shortdayofweekname}[3]{% |
---|
396 | \computedayofweek{#1}{#2}{#3}% |
---|
397 | \@ifundefined{languagename}{% |
---|
398 | \shortdayofweeknameidenglish{\dayofweek}}{% |
---|
399 | \@ifundefined{shortdayofweeknameid\languagename}{% |
---|
400 | \shortdayofweeknameidenglish{\dayofweek}}{% |
---|
401 | \csname shortdayofweeknameid\languagename\endcsname\dayofweek}}% |
---|
402 | } |
---|
403 | |
---|
404 | \fi |
---|
405 | |
---|
406 | \providecommand{\thisshortdayofweekname}{\dayofweekname{\day}{\month}{\year}} |
---|
407 | \if@dt@nodate |
---|
408 | \else |
---|
409 | \DeclareRobustCommand*{\today}{\formatdate{\day}{\month}{\year}} |
---|
410 | \fi |
---|
411 | \if@dt@nodate |
---|
412 | \else |
---|
413 | \@ifundefined{dateenglish}{}{\let\dateenglish\longdate} |
---|
414 | \@ifundefined{dateaustrian}{}{\input{dt-austrian.def}} |
---|
415 | \@ifundefined{datebahasa}{}{\input{dt-bahasa.def}} |
---|
416 | \@ifundefined{datebasque}{}{\input{dt-basque.def}} |
---|
417 | \@ifundefined{datebreton}{}{\input{dt-breton.def}} |
---|
418 | \@ifundefined{datebulgarian}{}{\input{dt-bulgarian.def}} |
---|
419 | \@ifundefined{datecatalan}{}{\input{dt-catalan.def}} |
---|
420 | \@ifundefined{datecroatian}{}{\input{dt-croatian.def}} |
---|
421 | \@ifundefined{dateczech}{}{\input{dt-czech.def}} |
---|
422 | \@ifundefined{datedanish}{}{\input{dt-danish.def}} |
---|
423 | \@ifundefined{datedutch}{}{\input{dt-dutch.def}} |
---|
424 | \@ifundefined{dateesperanto}{}{\input{dt-esperanto.def}} |
---|
425 | \@ifundefined{dateestonian}{}{\input{dt-estonian.def}} |
---|
426 | \@ifundefined{datefinnish}{}{\input{dt-finnish.def}} |
---|
427 | \@ifundefined{datefrench}{}{\input{dt-french.def}} |
---|
428 | \@ifundefined{dategalician}{}{\input{dt-galician.def}} |
---|
429 | \@ifundefined{dategerman}{}{\input{dt-german.def}} |
---|
430 | \@ifundefined{dategreek}{}{\input{dt-greek.def}} |
---|
431 | \@ifundefined{datehebrew}{}{\input{dt-hebrew.def}} |
---|
432 | \@ifundefined{dateicelandic}{}{\input{dt-icelandic.def}} |
---|
433 | \@ifundefined{dateirish}{}{\input{dt-irish.def}} |
---|
434 | \@ifundefined{dateitalian}{}{\input{dt-italian.def}} |
---|
435 | \@ifundefined{datelatin}{}{\input{dt-latin.def}} |
---|
436 | \@ifundefined{datelsorbian}{}{\input{dt-lsorbian.def}} |
---|
437 | \@ifundefined{datemagyar}{}{\input{dt-magyar.def}} |
---|
438 | \@ifundefined{datenaustrian}{}{\input{dt-naustrian.def}} |
---|
439 | \@ifundefined{datengerman}{}{\input{dt-ngerman.def}} |
---|
440 | \@ifundefined{datenorsk}{}{\input{dt-norsk.def}} |
---|
441 | \@ifundefined{datepolish}{}{\input{dt-polish.def}} |
---|
442 | \@ifundefined{dateportuges}{}{\input{dt-portuges.def}} |
---|
443 | \@ifundefined{dateromanian}{}{\input{dt-romanian.def}} |
---|
444 | \@ifundefined{daterussian}{}{\input{dt-russian.def}} |
---|
445 | \@ifundefined{datesamin}{}{\input{dt-samin.def}} |
---|
446 | \@ifundefined{datescottish}{}{\input{dt-scottish.def}} |
---|
447 | \@ifundefined{dateserbian}{}{\input{dt-serbian.def}} |
---|
448 | \@ifundefined{dateslovak}{}{\input{dt-slovak.def}} |
---|
449 | \@ifundefined{dateslovene}{}{\input{dt-slovene.def}} |
---|
450 | \@ifundefined{datespanish}{}{\input{dt-spanish.def}} |
---|
451 | \@ifundefined{dateswedish}{}{\input{dt-swedish.def}} |
---|
452 | \@ifundefined{dateturkish}{}{\input{dt-turkish.def}} |
---|
453 | \@ifundefined{dateukraineb}{}{\input{dt-ukraineb.def}} |
---|
454 | \@ifundefined{dateusorbian}{}{\input{dt-usorbian.def}} |
---|
455 | \@ifundefined{datewelsh}{}{\input{dt-welsh.def}} |
---|
456 | \fi |
---|
457 | \if@dt@nodate |
---|
458 | \typeout{datetime package message : option "nodate" used, so not defining \protect\newdateformat} |
---|
459 | \else |
---|
460 | |
---|
461 | \providecommand\THEDAY{\the\@day} |
---|
462 | \providecommand\THEMONTH{\the\@month} |
---|
463 | \providecommand\THEYEAR{\the\@year} |
---|
464 | \let\c@DAY=\@day |
---|
465 | \let\c@MONTH=\@month |
---|
466 | \let\c@YEAR=\@year |
---|
467 | |
---|
468 | \providecommand{\dateformat}[4]{\@day=#2\relax\@month=#3\relax\@year=#4\relax#1} |
---|
469 | |
---|
470 | \providecommand{\newdateformat}[2]{% |
---|
471 | \@ifundefined{#1}{\expandafter\DeclareRobustCommand\csname#1\endcsname{\renewcommand{\formatdate}{\dateformat{#2}}}}{% |
---|
472 | \PackageError{datetime}{Can't create new date format, command \textbackslash#1 already defined}{You will need to |
---|
473 | give you new date format a different name}}} |
---|
474 | \fi |
---|
475 | |
---|
476 | \newcount\c@HOUR |
---|
477 | \newcount\c@HOURXII |
---|
478 | \newcount\c@MINUTE |
---|
479 | \newcount\c@TOHOUR |
---|
480 | \newcount\c@TOMINUTE |
---|
481 | \def\THEHOUR{\the\c@HOUR} |
---|
482 | \def\THEHOURXII{\the\c@HOURXII} |
---|
483 | \def\THEMINUTE{\the\c@MINUTE} |
---|
484 | \def\THETOHOUR{\the\c@TOHOUR} |
---|
485 | \def\THETOMINUTE{\the\c@TOMINUTE} |
---|
486 | |
---|
487 | \providecommand{\newtimeformat}[2]{% |
---|
488 | \@ifundefined{#1}{% |
---|
489 | \expandafter\def\csname#1\endcsname{% |
---|
490 | \c@HOUR=\time% |
---|
491 | \divide\c@HOUR by 60\relax |
---|
492 | \c@HOURXII=\c@HOUR |
---|
493 | \ifnum\c@HOURXII>12 |
---|
494 | \advance\c@HOURXII by -12\relax |
---|
495 | \fi |
---|
496 | \c@MINUTE=\time% |
---|
497 | \@modulo{\c@MINUTE}{60}% |
---|
498 | \c@TOHOUR=\c@HOURXII |
---|
499 | \advance\c@TOHOUR by 1\relax |
---|
500 | \@modulo{\c@TOHOUR}{12}% |
---|
501 | \c@TOMINUTE=\c@MINUTE |
---|
502 | \advance\c@TOMINUTE by -60\relax |
---|
503 | \multiply\c@TOMINUTE by -1\relax |
---|
504 | #2\relax |
---|
505 | }}{% |
---|
506 | \PackageError{datetime}{Command \textbackslash#1 already defined}{% |
---|
507 | You can't create a new time format called "#1" as the command \textbackslash#1 already exists}}} |
---|
508 | \newtimeformat{xxivtime}{\twodigit\THEHOUR\timeseparator\twodigit\THEMINUTE} |
---|
509 | |
---|
510 | \newtimeformat{ampmtime}{\THEHOURXII\timeseparator\twodigit\THEMINUTE\ifthenelse{\value{HOUR}<12}{\amname}{\ifthenelse{\time=720}{ \noon}{\pmname}}} |
---|
511 | |
---|
512 | \newtimeformat{oclock}{\ifthenelse{\time=0 \or \time=720}{% |
---|
513 | \ifthenelse{\time=0}{\midnight}{\noon}}{% |
---|
514 | \ifthenelse{\value{MINUTE}=0}{% |
---|
515 | \Numberstring{HOUR} \oclockstring}{% |
---|
516 | \ifthenelse{\value{MINUTE}=15}{% |
---|
517 | \quarterpast\ \Numberstring{HOUR}}{% |
---|
518 | \ifthenelse{\value{MINUTE}=30}{% |
---|
519 | \halfpast\ \Numberstring{HOUR}}{% |
---|
520 | \ifthenelse{\value{MINUTE}=45}{% |
---|
521 | \quarterto\ \Numberstring{TOHOUR}}{% |
---|
522 | \ifthenelse{\value{MINUTE}<30}{% |
---|
523 | \Numberstring{MINUTE}\ \ifthenelse{\value{MINUTE}=1}{minute}{minutes} past \Numberstring{HOURXII}}{% |
---|
524 | \Numberstring{TOMINUTE}\ \ifthenelse{\value{TOMINUTE}=1}{minute}{minutes} to \Numberstring{TOHOUR}}}}}}\ |
---|
525 | \ifthenelse{\value{HOUR}<12}{% |
---|
526 | \amstring}{% |
---|
527 | \pmstring}}} |
---|
528 | |
---|
529 | \providecommand{\amname}{am} |
---|
530 | \providecommand{\pmname}{pm} |
---|
531 | \providecommand{\amorpmname}{\ifthenelse{\value{HOUR}>12}{\pmname}{\amname}} |
---|
532 | \providecommand{\amstring}{in the morning} |
---|
533 | \providecommand{\pmstring}{in the afternoon} |
---|
534 | \providecommand{\amorpmstring}{\ifthenelse{\value{HOUR}>12}{\pmstring}{\amstring}} |
---|
535 | \providecommand{\halfpast}{Half past} |
---|
536 | \providecommand{\quarterpast}{Quarter past} |
---|
537 | \providecommand{\quarterto}{Quarter to} |
---|
538 | \providecommand{\noon}{Noon} |
---|
539 | \providecommand{\midnight}{Midnight} |
---|
540 | \providecommand{\oclockstring}{O'Clock} |
---|
541 | |
---|
542 | \newcount\pdftimectr |
---|
543 | \newcount\pdfdatectr |
---|
544 | |
---|
545 | \pdftimectr=0\relax |
---|
546 | \@dtctr=\time% |
---|
547 | \divide\@dtctr by 60\relax |
---|
548 | \multiply\@dtctr by 10000\relax |
---|
549 | \pdftimectr=\@dtctr |
---|
550 | \@dtctr=\time% |
---|
551 | \@modulo{\@dtctr}{60}% |
---|
552 | \multiply\@dtctr by 100\relax |
---|
553 | \advance\pdftimectr by \@dtctr |
---|
554 | \pdfdatectr=\day |
---|
555 | \@dtctr=\month |
---|
556 | \multiply\@dtctr by 100\relax |
---|
557 | \advance\pdfdatectr by \@dtctr |
---|
558 | \@dtctr=\year |
---|
559 | \multiply\@dtctr by 10000\relax |
---|
560 | \advance\pdfdatectr by \@dtctr |
---|
561 | \ifnum\pdftimectr<100000 |
---|
562 | \edef\pdfdate{\the\pdfdatectr0\the\pdftimectr} |
---|
563 | \else |
---|
564 | \edef\pdfdate{\the\pdfdatectr\the\pdftimectr} |
---|
565 | \fi |
---|
566 | \endinput |
---|
567 | %% |
---|
568 | %% End of file `datetime.sty'. |
---|