diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/datetime/datetime.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/datetime/datetime.sty | 436 |
1 files changed, 314 insertions, 122 deletions
diff --git a/Master/texmf-dist/tex/latex/datetime/datetime.sty b/Master/texmf-dist/tex/latex/datetime/datetime.sty index 5acf82beff7..984470e5165 100644 --- a/Master/texmf-dist/tex/latex/datetime/datetime.sty +++ b/Master/texmf-dist/tex/latex/datetime/datetime.sty @@ -7,7 +7,7 @@ %% datetime.dtx (with options: `datetime.sty,package') %% %% datetime.dtx -%% Copyright 2007 Nicola Talbot +%% Copyright 2009 Nicola Talbot %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -21,7 +21,7 @@ %% %% The Current Maintainer of this work is Nicola Talbot. %% -%% This work consists of the files datetime.dtx and datetime.ins and the derived files datetime.sty, dt-austrian.def, dt-bahasa.def, dt-basque.def, dt-breton.def, dt-british.def, dt-bulgarian.def, dt-catalan.def, dt-croatian.def, dt-czech.def, dt-danish.def, dt-dutch.def, dt-esperanto.def, dt-estonian.def, dt-finnish.def, dt-french.def, dt-galician.def, dt-german.def, dt-greek.def, dt-hebrew.def, dt-icelandic.def, dt-irish.def, dt-italian.def, dt-latin.def, dt-lsorbian.def, dt-magyar.def, dt-naustrian.def, dt-ngerman.def, dt-norsk.def, dt-polish.def, dt-portuges.def, dt-romanian.def, dt-russian.def, dt-samin.def, dt-scottish.def, dt-serbian.def, dt-slovak.def, dt-slovene.def, dt-spanish.def, dt-swedish.def, dt-turkish.def, dt-UKenglish.def, dt-ukraineb.def, dt-USenglish.def, dt-usorbian.def, dt-welsh.def. +%% This work consists of the files datetime.dtx and datetime.ins and the derived files datetime.sty, dt-american.def, dt-austrian.def, dt-bahasa.def, dt-basque.def, dt-breton.def, dt-british.def, dt-bulgarian.def, dt-catalan.def, dt-croatian.def, dt-czech.def, dt-danish.def, dt-dutch.def, dt-esperanto.def, dt-estonian.def, dt-finnish.def, dt-french.def, dt-galician.def, dt-german.def, dt-greek.def, dt-hebrew.def, dt-icelandic.def, dt-irish.def, dt-italian.def, dt-latin.def, dt-lsorbian.def, dt-magyar.def, dt-naustrian.def, dt-ngerman.def, dt-norsk.def, dt-polish.def, dt-portuges.def, dt-romanian.def, dt-russian.def, dt-samin.def, dt-scottish.def, dt-serbian.def, dt-slovak.def, dt-slovene.def, dt-spanish.def, dt-swedish.def, dt-turkish.def, dt-UKenglish.def, dt-ukraineb.def, dt-USenglish.def, dt-usorbian.def, dt-welsh.def. %% %% \CharacterTable %% {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 @@ -39,8 +39,9 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datetime}[2007/08/20 v2.55 Date Time Package] +\ProvidesPackage{datetime}[2009/11/16 v2.56 Date Time Package] \RequirePackage{fmtcount} +\RequirePackage{ifthen} \newif\if@dt@nodate \@dt@nodatefalse \newcommand{\dateseparator}{/} @@ -50,12 +51,6 @@ \@ifpackageloaded{ngerman}{% \@dt@multilingualtrue}{\@dt@multilingualfalse}} \newcommand*{\ordinaldateenglish}[1]{\ordinalnum{#1}} -\newcommand*{\ordinaldatewelsh}[1]{% -#1\ifnum#1=1\/\textsuperscript{a\~n}\fi} -\newcommand*{\ordinaldatebreton}[1]{% -#1\ifnum#1=1\/\textsuperscript{a\~n}\fi} -\newcommand*{\ordinaldatefrench}[1]{% -#1\ifnum#1=1\ier\fi} \newcommand*{\ordinaldate}[1]{% \if@dt@multilingual \@ifundefined{ordinaldate\languagename}{#1}{% @@ -63,7 +58,6 @@ \else \ordinalnum{#1}% \fi} -\providecommand*{\ier}{\textsuperscript{er}} \newif\ifshowdow \providecommand*{\formatdate}[3]{} \newcount\@day @@ -80,6 +74,11 @@ \@day=##1\relax\@month=##2\relax\@year=##3\relax \ordinaldate{\the\@day}\ \shortmonthname[\@month], \the\@year}} \let\twodigit\two@digits +\DeclareRobustCommand*{\yyyymmdddate}{% +\renewcommand*{\formatdate}[3]{% +\@day=##1\relax\@month=##2\relax\@year=##3\relax +\the\@year\dateseparator \twodigit\@month\dateseparator +\twodigit\@day}} \DeclareRobustCommand*{\ddmmyyyydate}{% \renewcommand*{\formatdate}[3]{% \@day=##1\relax\@month=##2\relax\@year=##3\relax @@ -155,41 +154,318 @@ \formatdate{\csname date@#1@d\endcsname}{% \csname date@#1@m\endcsname}{% \csname date@#1@y\endcsname}}} -\DeclareRobustCommand*{\currenttime}{\xxivtime} -\newcommand*{\timeseparator}{:} -\providecommand*{\settimeformat}[1]{% -\DeclareRobustCommand*\currenttime{\csname#1\endcsname}} \longdate \showdowtrue +\providecommand*\THEDAY{\the\@day} +\providecommand*\THEMONTH{\the\@month} +\providecommand*\THEYEAR{\the\@year} +\let\c@DAY=\@day +\let\c@MONTH=\@month +\let\c@YEAR=\@year +\providecommand{\newdateformat}[2]{% +\@ifundefined{#1}{% +\expandafter\DeclareRobustCommand\csname#1\endcsname{% +\renewcommand{\formatdate}{\dateformat{#2}}}}{% +\PackageError{datetime}{Can't create new date format, command +\textbackslash#1 already defined}{You will need to +give your new date format a different name}}} +\DeclareRobustCommand*{\currenttime}{% + \formattime{\currenthour}{\currentminute}{\currentsecond}% +} +\newcommand*{\formattime}[3]{\protect\@formattime{#1}{#2}{#3}} +\newcommand*{\@formattime}[3]{% + \csname timeformat@xxivtime\endcsname{#1}{#2}{#3}} +\newcommand*{\timeseparator}{:} +\providecommand*{\settimeformat}[1]{% + \@ifundefined{timeformat@#1}{% + \PackageError{datetime}{Unknown time format `#1'}{}% + }{% + \renewcommand*{\@formattime}[3]{% + \csname timeformat@#1\endcsname{##1}{##2}{##3}}% + }% +} +\newcount\c@HOUR +\newcount\c@HOURXII +\newcount\c@MINUTE +\newcount\c@TOHOUR +\newcount\c@TOMINUTE +\newcount\c@SECOND +\def\THEHOUR{\the\c@HOUR} +\def\THEHOURXII{\the\c@HOURXII} +\def\THEMINUTE{\the\c@MINUTE} +\def\THETOHOUR{\the\c@TOHOUR} +\def\THETOMINUTE{\the\c@TOMINUTE} +\def\THESECOND{\the\c@SECOND} +\newcount\currenthour +\newcount\currentminute +\newcount\currentsecond +{\catcode`\D=12\relax + \gdef\@dt@getdate D:#1#2#3#4#5#6#7#8{\@dt@gettime}% +} +\@ifundefined{pdfcreationdate}{% + \currenthour=\time\relax + \divide\currenthour by 60\relax + \currentminute=\time\relax + \@modulo{\currentminute}{60}% + \currentsecond=0\relax +}{% + \def\@dt@gettime#1#2#3#4#5#6#7\relax{% + \currenthour=#1#2\relax + \currentminute=#3#4\relax + \currentsecond=#5#6\relax}% + \expandafter\@dt@getdate\pdfcreationdate\relax +} +\providecommand*{\newtimeformat}[2]{% +\@ifundefined{#1}{% +\expandafter\def\csname#1\endcsname{% + \csname timeformat@#1\endcsname{\currenthour}{\currentminute}% + {\currentsecond}% +}% +\expandafter\def\csname timeformat@#1\endcsname##1##2##3{% +\c@HOUR=##1% +\c@HOURXII=\c@HOUR +\ifnum\c@HOURXII>12 +\advance\c@HOURXII by -12\relax +\fi +\c@MINUTE=##2% +\c@TOHOUR=\c@HOURXII +\advance\c@TOHOUR by 1\relax +\@modulo{\c@TOHOUR}{12}% +\c@TOMINUTE=\c@MINUTE +\advance\c@TOMINUTE by -60\relax +\multiply\c@TOMINUTE by -1\relax +\c@SECOND=##3\relax +#2\relax +}}{% +\PackageError{datetime}{Command \textbackslash#1 already defined}{% +You can't create a new time format called "#1" as the command +\textbackslash#1 already exists}}} +\newtimeformat{xxivtime}{% +\twodigit\THEHOUR\timeseparator\twodigit\THEMINUTE} +\newtimeformat{hhmmsstime}{% +\twodigit\THEHOUR\timeseparator\twodigit\THEMINUTE\timeseparator +\twodigit\THESECOND} +\newtimeformat{ampmtime}{% +\ifthenelse{\value{HOUR}=0}{12}{\THEHOURXII}\timeseparator +\twodigit\THEMINUTE +\ifthenelse{\value{HOUR}<12}{\amname}{% +\ifthenelse{\value{HOUR}=12}{ \noon}{\pmname}}} +\newcommand*{\hourstring}[1]{% +\ifthenelse{\value{#1}=0}{\midnight}{\Numberstring{#1}}} +\newtimeformat{oclock}{% + \ifthenelse{\(\value{HOUR}=0 \OR \value{HOUR}=12 \OR\value{HOUR}=24\)\AND + \value{MINUTE}=0}{% +\ifthenelse{\value{HOUR}=12}{\noon}{\midnight}}{% +\ifthenelse{\value{MINUTE}=0}{% +\Numberstring{HOUR} \oclockstring}{% +\ifthenelse{\value{MINUTE}=15}{% +\quarterpast\ \hourstring{HOUR}}{% +\ifthenelse{\value{MINUTE}=30}{% +\halfpast\ \hourstring{HOUR}}{% +\ifthenelse{\value{MINUTE}=45}{% +\quarterto\ \hourstring{TOHOUR}}{% +\ifthenelse{\value{MINUTE}<30}{% +\Numberstring{MINUTE}\ \ifthenelse{\value{MINUTE}=1}{minute}{minutes} +past \hourstring{HOURXII}}{% +\Numberstring{TOMINUTE}\ \ifthenelse{% +\value{TOMINUTE}=1}{minute}{minutes} to \hourstring{TOHOUR}}}}}}% +\ifthenelse{\value{HOUR}<12}{% +\ifthenelse{\value{HOUR}=0}{}{\ \amstring}}{% +\ifthenelse{\value{TOHOUR}=0}{}{\ \pmstring}}}} +\providecommand*{\amname}{am} +\providecommand*{\pmname}{pm} +\providecommand*{\amorpmname}{% +\ifthenelse{\value{HOUR}>12}{\pmname}{\amname}} +\providecommand*{\amstring}{in the morning} +\providecommand*{\pmstring}{in the afternoon} +\providecommand*{\amorpmstring}{% +\ifthenelse{\value{HOUR}>12}{\pmstring}{\amstring}} +\providecommand*{\halfpast}{Half past} +\providecommand*{\quarterpast}{Quarter past} +\providecommand*{\quarterto}{Quarter to} +\providecommand*{\noon}{Noon} +\providecommand*{\midnight}{Midnight} +\providecommand*{\oclockstring}{O'Clock} \InputIfFileExists{datetime.cfg}{\PackageInfo{datetime}{% Loading local datetime configurations}}{% \PackageInfo{datetime}{No datetime.cfg file found, using default settings}} +\@ifpackageloaded{babel}{% + \newcommand*{\dt@addtoextras}[1]{% + \@ifundefined{extrasenglish}{}{% + \addto\extrasenglish{#1}% + }% + \@ifundefined{extrasamerican}{}{% + \addto\extrasamerican{#1}% + }% + \@ifundefined{extrasaustrian}{}{% + \addto\extrasaustrian{#1}% + }% + \@ifundefined{extrasbahasa}{}{% + \addto\extrasbahasa{#1}% + }% + \@ifundefined{extrasbreton}{}{% + \addto\extrasbreton{#1}% + }% + \@ifundefined{extrasbritish}{}{% + \addto\extrasbritish{#1}% + }% + \@ifundefined{extrasbulgarian}{}{% + \addto\extrasbulgarian{#1}% + }% + \@ifundefined{extrascatalan}{}{% + \addto\extrascatalan{#1}% + }% + \@ifundefined{extrascroatian}{}{% + \addto\extrascroatian{#1}% + }% + \@ifundefined{extrasczech}{}{% + \addto\extrasczech{#1}% + }% + \@ifundefined{extrasdanish}{}{% + \addto\extrasdanish{#1}% + }% + \@ifundefined{extrasesperanto}{}{% + \addto\extrasesperanto{#1}% + }% + \@ifundefined{extrasestonian}{}{% + \addto\extrasestonian{#1}% + }% + \@ifundefined{extrasfinnish}{}{% + \addto\extrasfinnish{#1}% + }% + \@ifundefined{extrasfrench}{}{% + \addto\extrasfrench{#1}% + }% + \@ifundefined{extrasgalician}{}{% + \addto\extrasgalician{#1}% + }% + \@ifundefined{extrasgerman}{}{% + \addto\extrasgerman{#1}% + }% + \@ifundefined{extrasgreek}{}{% + \addto\extrasgreek{#1}% + }% + \@ifundefined{extrashebrew}{}{% + \addto\extrashebrew{#1}% + }% + \@ifundefined{extrasicelandic}{}{% + \addto\extrasicelandic{#1}% + }% + \@ifundefined{extrasirish}{}{% + \addto\extrasirish{#1}% + }% + \@ifundefined{extrasitalian}{}{% + \addto\extrasitalian{#1}% + }% + \@ifundefined{extraslatin}{}{% + \addto\extraslatin{#1}% + }% + \@ifundefined{extraslsorbian}{}{% + \addto\extraslsorbian{#1}% + }% + \@ifundefined{extrasmagyar}{}{% + \addto\extrasmagyar{#1}% + }% + \@ifundefined{extrasnaustrian}{}{% + \addto\extrasnaustrian{#1}% + }% + \@ifundefined{extrasngerman}{}{% + \addto\extrasngerman{#1}% + }% + \@ifundefined{extrasnorsk}{}{% + \addto\extrasnorsk{#1}% + }% + \@ifundefined{extraspolish}{}{% + \addto\extraspolish{#1}% + }% + \@ifundefined{extrasportuges}{}{% + \addto\extrasportuges{#1}% + }% + \@ifundefined{extrasromanian}{}{% + \addto\extrasromanian{#1}% + }% + \@ifundefined{extrasrussian}{}{% + \addto\extrasrussian{#1}% + }% + \@ifundefined{extrassamin}{}{% + \addto\extrassamin{#1}% + }% + \@ifundefined{extrasscottish}{}{% + \addto\extrasscottish{#1}% + }% + \@ifundefined{extrasserbian}{}{% + \addto\extrasserbian{#1}% + }% + \@ifundefined{extrasslovak}{}{% + \addto\extrasslovak{#1}% + }% + \@ifundefined{extrasslovene}{}{% + \addto\extrasslovene{#1}% + }% + \@ifundefined{extrasspanish}{}{% + \addto\extrasspanish{#1}% + }% + \@ifundefined{extrasswedish}{}{% + \addto\extrasswedish{#1}% + }% + \@ifundefined{extrasturkish}{}{% + \addto\extrasturkish{#1}% + }% + \@ifundefined{extrasUKenglish}{}{% + \addto\extrasUKenglish{#1}% + }% + \@ifundefined{extrasukraine}{}{% + \addto\extrasukraine{#1}% + }% + \@ifundefined{extrasUSenglish}{}{% + \addto\extrasUSenglish{#1}% + }% + \@ifundefined{extrasusorbian}{}{% + \addto\extrasusorbian{#1}% + }% + \@ifundefined{extraswelsh}{}{% + \addto\extraswelsh{#1}% + }% + } +}{% + \newcommand*{\dt@addtoextras}[1]{} +} +\newcommand*{\setdefaultdate}[1]{\dt@addtoextras{#1}#1} \RequirePackage{fmtcount} -\DeclareOption{long}{\longdate} -\DeclareOption{short}{\shortdate} -\DeclareOption{ddmmyyyy}{\ddmmyyyydate} -\DeclareOption{dmyyyy}{\dmyyyydate} -\DeclareOption{ddmmyy}{\ddmmyydate} -\DeclareOption{dmyy}{\dmyydate} -\DeclareOption{text}{\textdate} -\DeclareOption{us}{\usdate} -\DeclareOption{mmddyyyy}{\mmddyyyydate} -\DeclareOption{mdyyyy}{\mdyyyydate} -\DeclareOption{mmddyy}{\mmddyydate} -\DeclareOption{mdyy}{\mdyydate} +\DeclareOption{long}{\setdefaultdate{\longdate}} +\DeclareOption{short}{\setdefaultdate{\shortdate}} +\DeclareOption{yyyymmdd}{\setdefaultdate{\yyyymmdddate}} +\DeclareOption{ddmmyyyy}{\setdefaultdate{\ddmmyyyydate}} +\DeclareOption{dmyyyy}{\setdefaultdate{\dmyyyydate}} +\DeclareOption{ddmmyy}{\setdefaultdate{\ddmmyydate}} +\DeclareOption{dmyy}{\setdefaultdate{\dmyydate}} +\DeclareOption{text}{\setdefaultdate{\textdate}} +\DeclareOption{us}{\setdefaultdate{\usdate}} +\DeclareOption{mmddyyyy}{\setdefaultdate{\mmddyyyydate}} +\DeclareOption{mdyyyy}{\setdefaultdate{\mdyyyydate}} +\DeclareOption{mmddyy}{\setdefaultdate{\mmddyydate}} +\DeclareOption{mdyy}{\setdefaultdate{\mdyydate}} \DeclareOption{level}{\fmtcountsetoptions{fmtord=level}} \DeclareOption{raise}{\fmtcountsetoptions{fmtord=raise}} \DeclareOption{dayofweek}{\showdowtrue} \DeclareOption{nodayofweek}{\showdowfalse} \DeclareOption{nodate}{\@dt@nodatetrue} +\DeclareOption{hhmmss}{\settimeformat{hhmmsstime}} \DeclareOption{24hr}{\settimeformat{xxivtime}} \DeclareOption{12hr}{\settimeformat{ampmtime}} \DeclareOption{oclock}{\settimeformat{oclock}} +\DeclareOption{iso}{% + \setdefaultdate{\yyyymmdddate}\settimeformat{hhmmsstime}% + \renewcommand*{\dateseparator}{-}% + \renewcommand*{\timeseparator}{:}% +} \DeclareOption{austrian}{\input{dt-austrian.def}} +\DeclareOption{american}{\input{dt-american.def}} \DeclareOption{bahasa}{\input{dt-bahasa.def}} \DeclareOption{basque}{\input{dt-basque.def}} \DeclareOption{breton}{\input{dt-breton.def}} +\DeclareOption{british}{\input{dt-british.def}} \DeclareOption{bulgarian}{\input{dt-bulgarian.def}} \DeclareOption{catalan}{\input{dt-catalan.def}} \DeclareOption{croatian}{\input{dt-croatian.def}} @@ -201,7 +477,7 @@ settings}} \DeclareOption{finnish}{\input{dt-finnish.def}} \DeclareOption{french}{\input{dt-french.def}} \DeclareOption{galician}{\input{dt-galician.def}} -\DeclareOption{german}{\input{dt-german.def}} +\DeclareOption{german}{\input{dt-german.def}\dategerman} \DeclareOption{greek}{\input{dt-greek.def}} \DeclareOption{hebrew}{\input{dt-hebrew.def}} \DeclareOption{icelandic}{\input{dt-icelandic.def}} @@ -211,7 +487,7 @@ settings}} \DeclareOption{lsorbian}{\input{dt-lsorbian.def}} \DeclareOption{magyar}{\input{dt-magyar.def}} \DeclareOption{naustrian}{\input{dt-naustrian.def}} -\DeclareOption{ngerman}{\input{dt-ngerman.def}} +\DeclareOption{ngerman}{\input{dt-ngerman.def}\datengerman} \DeclareOption{norsk}{\input{dt-norsk.def}} \DeclareOption{polish}{\input{dt-polish.def}} \DeclareOption{portuges}{\input{dt-portuges.def}} @@ -227,9 +503,17 @@ settings}} \DeclareOption{turkish}{\input{dt-turkish.def}} \DeclareOption{ukraineb}{\input{dt-ukraineb.def}} \DeclareOption{usorbian}{\input{dt-usorbian.def}} +\DeclareOption{UKenglish}{\input{dt-UKenglish.def}} +\DeclareOption{USenglish}{\input{dt-USenglish.def}} \DeclareOption{welsh}{\input{dt-welsh.def}} \ProcessOptions -\RequirePackage{ifthen} +\if@dt@nodate + \PackageInfo{datetime}{option "nodate" used, so note defining +\string\dateformat} +\else +\providecommand*{\dateformat}[4]{% +\@day=#2\relax\@month=#3\relax\@year=#4\relax#1} +\fi \if@dt@nodate \PackageInfo{datetime}{option "nodate" used, so not defining \string\monthname} @@ -433,6 +717,7 @@ language '\languagename', defaulting to long version}}% \@ifundefined{dateUKenglish}{}{\input{dt-UKenglish.def}} \@ifundefined{dateUSenglish}{}{\input{dt-USenglish.def}} \@ifundefined{datebritish}{}{\input{dt-british.def}} +\@ifundefined{dateamerican}{}{\input{dt-american.def}} \@ifundefined{dateaustrian}{}{\input{dt-austrian.def}} \@ifundefined{datebahasa}{}{\input{dt-bahasa.def}} \@ifundefined{datebasque}{}{\input{dt-basque.def}} @@ -476,99 +761,6 @@ language '\languagename', defaulting to long version}}% \@ifundefined{dateusorbian}{}{\input{dt-usorbian.def}} \@ifundefined{datewelsh}{}{\input{dt-welsh.def}} \fi -\if@dt@nodate -\PackageInfo{datetime}{option "nodate" used, so not -defining \string\newdateformat} -\else -\providecommand*\THEDAY{\the\@day} -\providecommand*\THEMONTH{\the\@month} -\providecommand*\THEYEAR{\the\@year} -\let\c@DAY=\@day -\let\c@MONTH=\@month -\let\c@YEAR=\@year -\providecommand*{\dateformat}[4]{% -\@day=#2\relax\@month=#3\relax\@year=#4\relax#1} -\providecommand{\newdateformat}[2]{% -\@ifundefined{#1}{% -\expandafter\DeclareRobustCommand\csname#1\endcsname{% -\renewcommand{\formatdate}{\dateformat{#2}}}}{% -\PackageError{datetime}{Can't create new date format, command -\textbackslash#1 already defined}{You will need to -give your new date format a different name}}} -\fi -\newcount\c@HOUR -\newcount\c@HOURXII -\newcount\c@MINUTE -\newcount\c@TOHOUR -\newcount\c@TOMINUTE -\def\THEHOUR{\the\c@HOUR} -\def\THEHOURXII{\the\c@HOURXII} -\def\THEMINUTE{\the\c@MINUTE} -\def\THETOHOUR{\the\c@TOHOUR} -\def\THETOMINUTE{\the\c@TOMINUTE} -\providecommand*{\newtimeformat}[2]{% -\@ifundefined{#1}{% -\expandafter\def\csname#1\endcsname{% -\c@HOUR=\time% -\divide\c@HOUR by 60\relax -\c@HOURXII=\c@HOUR -\ifnum\c@HOURXII>12 -\advance\c@HOURXII by -12\relax -\fi -\c@MINUTE=\time% -\@modulo{\c@MINUTE}{60}% -\c@TOHOUR=\c@HOURXII -\advance\c@TOHOUR by 1\relax -\@modulo{\c@TOHOUR}{12}% -\c@TOMINUTE=\c@MINUTE -\advance\c@TOMINUTE by -60\relax -\multiply\c@TOMINUTE by -1\relax -#2\relax -}}{% -\PackageError{datetime}{Command \textbackslash#1 already defined}{% -You can't create a new time format called "#1" as the command -\textbackslash#1 already exists}}} -\newtimeformat{xxivtime}{% -\twodigit\THEHOUR\timeseparator\twodigit\THEMINUTE} -\newtimeformat{ampmtime}{% -\ifthenelse{\value{HOUR}=0}{12}{\THEHOURXII}\timeseparator -\twodigit\THEMINUTE -\ifthenelse{\value{HOUR}<12}{\amname}{% -\ifthenelse{\time=720}{ \noon}{\pmname}}} -\newcommand*{\hourstring}[1]{% -\ifthenelse{\value{#1}=0}{\midnight}{\Numberstring{#1}}} -\newtimeformat{oclock}{\ifthenelse{\time=0 \or \time=720}{% -\ifthenelse{\time=0}{\midnight}{\noon}}{% -\ifthenelse{\value{MINUTE}=0}{% -\Numberstring{HOUR} \oclockstring}{% -\ifthenelse{\value{MINUTE}=15}{% -\quarterpast\ \hourstring{HOUR}}{% -\ifthenelse{\value{MINUTE}=30}{% -\halfpast\ \hourstring{HOUR}}{% -\ifthenelse{\value{MINUTE}=45}{% -\quarterto\ \hourstring{TOHOUR}}{% -\ifthenelse{\value{MINUTE}<30}{% -\Numberstring{MINUTE}\ \ifthenelse{\value{MINUTE}=1}{minute}{minutes} -past \hourstring{HOURXII}}{% -\Numberstring{TOMINUTE}\ \ifthenelse{% -\value{TOMINUTE}=1}{minute}{minutes} to \hourstring{TOHOUR}}}}}}% -\ifthenelse{\value{HOUR}<12}{% -\ifthenelse{\value{HOUR}=0}{}{\ \amstring}}{% -\ifthenelse{\value{TOHOUR}=0}{}{\ \pmstring}}}} -\providecommand*{\amname}{am} -\providecommand*{\pmname}{pm} -\providecommand*{\amorpmname}{% -\ifthenelse{\value{HOUR}>12}{\pmname}{\amname}} -\providecommand*{\amstring}{in the morning} -\providecommand*{\pmstring}{in the afternoon} -\providecommand*{\amorpmstring}{% -\ifthenelse{\value{HOUR}>12}{\pmstring}{\amstring}} -\providecommand*{\halfpast}{Half past} -\providecommand*{\quarterpast}{Quarter past} -\providecommand*{\quarterto}{Quarter to} -\providecommand*{\noon}{Noon} -\providecommand*{\midnight}{Midnight} -\providecommand*{\oclockstring}{O'Clock} \newtoks\dt@a \newtoks\dt@b \edef\pdfdate{\the\year} \dt@b=\expandafter{\pdfdate} |