From fabf181c6946e1e5ea931f003df726c9c1c553b8 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 24 Aug 2007 18:42:16 +0000 Subject: datetime 2.55 (20aug07) git-svn-id: svn://tug.org/texlive/trunk@4803 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/datetime/datetime.dtx | 2831 ++++---------------- .../texmf-dist/source/latex/datetime/datetime.ins | 165 +- 2 files changed, 641 insertions(+), 2355 deletions(-) (limited to 'Master/texmf-dist/source/latex/datetime') diff --git a/Master/texmf-dist/source/latex/datetime/datetime.dtx b/Master/texmf-dist/source/latex/datetime/datetime.dtx index 5a2c06c745a..0e1d7254c5c 100644 --- a/Master/texmf-dist/source/latex/datetime/datetime.dtx +++ b/Master/texmf-dist/source/latex/datetime/datetime.dtx @@ -1,17 +1,13 @@ %\iffalse -% datetime.dtx generated using makedtx version 0.91b (c) Nicola Talbot +% datetime.dtx generated using makedtx version 0.94b (c) Nicola Talbot % Command line args: -% -macrocode ".*\.perl" -% -setambles ".*\.perl=>\nopreamble\nopostamble" % -src "(.+)\.(sty)=>\1.\2" % -src "(.+)\.(def)=>\1.\2" -% -src "(.+)\.(perl)=>\1.\2" -% -src "(dt-sampl\.tex)=>\1" % -doc "manual.tex" % -author "Nicola Talbot" % -dir "source" % datetime -% Created on 2007/4/21 19:13 +% Created on 2007/8/20 15:37 %\fi %\iffalse %<*package> @@ -47,57 +43,58 @@ pdftitle={datetime.sty: A Date and Time Package}, pdfkeywords={date,time,LaTeX}]{hyperref} -\CheckSum{4522} +\CheckSum{4044} -\newcommand{\stynamefmt}[1]{\textsf{#1}} +\newcommand{\sty}[1]{\textsf{#1}} \begin{document} \DocInput{datetime.dtx} \end{document} % %\fi -% %\RecordChanges %\OnlyDescription -%\def\docdate{21 April 2007} -% -%\changes{v2.46}{30 Sep 2005}{'today defined using 'DeclareRobustCommand} -%\changes{v2.41}{22 Oct 2004}{'today defined using 'providecommand instead of 'renewcommand} % -% \title{datetime.sty v2.52: Formatting Current Date and +%\title{datetime.sty v2.55: Formatting Current Date and %Time} -% \author{Nicola L.C. Talbot} -% \date{\docdate} +% \author{Nicola L. C. Talbot\\[10pt] +% School of Computing Sciences\\ +% University of East Anglia\\ +% Norwich. NR4 7TJ.\\ +% United Kingdom.\\ +% \url{http://theoval.cmp.uea.ac.uk/~nlct/}} +% \date{20 Aug 2007} % \maketitle % \tableofcontents % \section{Introduction} -%\changes{v1.0}{8 Aug 2000}{First release} -%\changes{v1.01}{18 Sept 2000}{Documentation added} -%The \stynamefmt{datetime} package is a \LaTeXe\ package that -%provides various different formats for \verb"\today", +%\changes{1.0}{2000/08/08}{First release} +%\changes{1.01}{2000/09/18}{Documentation added} +%The \sty{datetime} package is a \LaTeXe\ package that +%provides various different formats for \cs{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 \texttt{nodate} to the package. -%\changes{v2.3}{1 May 2004}{nodate option added} +%\changes{2.3}{2004/05/01}{nodate package option added} % -%\changes{v2.41}{22 Oct 2004}{split package into two files: +%\changes{2.41}{2004/10/22}{split package into two files: %datetime.sty and fmtcount.sty} -%Since version 2.4, the \stynamefmt{datetime} package has been -%separated into two packages: \stynamefmt{datetime} and -%\stynamefmt{fmtcount}. When I originally created this package, -%I defined the commands, \verb"\ordinal" etc which could be used -%in the definition of \verb"\today". Since then, I have extended +%Since version 2.4, the \sty{datetime} package has been +%separated into two packages: \sty{datetime} and +%\sty{fmtcount}. When I originally created this package, +%I defined the commands, \cs{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 \stynamefmt{fmtcount} package is now distributed separately -%from the \stynamefmt{datetime} package, and will also need to +%The \sty{fmtcount} package is now distributed separately +%from the \sty{datetime} package, and will also need to %be installed. % -%\changes{v2.42}{1 Nov 2004}{make package compatible with babel} -%As from version 2.42, the \stynamefmt{datetime} package is now -%compatible with \stynamefmt{babel}, however you must load the -%\stynamefmt{datetime} package \emph{after} the \stynamefmt{babel} package. For example: +%\changes{2.42}{2004/11/01}{made package compatible with babel} +%As from version 2.42, the \sty{datetime} package is now +%compatible with \sty{babel}, however you must load the +%\sty{datetime} package \emph{after} the \sty{babel} package. +%For example: %\begin{verbatim} %\usepackage[francais]{babel} %\usepackage{datetime} @@ -105,7 +102,7 @@ % % \section{Date Declarations} % There are various declarations that change the effect of -%\verb"\today". The change can be localised by placing the +%\cs{today}. The change can be localised by placing the %declaration within a group. % % \vspace{10pt}\noindent \meta{Day} \meta{Month} \meta{Year} formats:\\ @@ -143,7 +140,14 @@ %\verb"\today" to produce the current date displayed in the form: %Wednesday the Eighth of March, Two Thousand if the package option %\texttt{dayofweek} is used, or Eighth of March, Two Thousand if -%the package option \texttt{nodayofweek} is used. +%the package option \texttt{nodayofweek} is used. Note that +%\verb"\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. % % \vspace{10pt}\noindent \meta{Month} \meta{Day} \meta{Year} formats:\\ % \DescribeMacro{\usdate} @@ -169,11 +173,10 @@ % %\vspace{10pt}\noindent In addition, the declarations \verb"\date"\meta{lang} are %available for all languages defined either by -%calling \stynamefmt{babel} prior to \stynamefmt{datetime} or by -%passing the language name as an option to \stynamefmt{datetime}. +%calling \sty{babel} prior to \sty{datetime} or by +%passing the language name as an option to \sty{datetime}. %See~\autoref{sec:newdate} if you want to define your own customised date format. % -%\changes{v2.43}{25 Feb 2005}{added 'dateseparator}% %As from version 2.43, the numerical date formats (such as %\verb"\ddmmyyyydate") use the command %\verb"\dateseparator" to separate the numbers. So, for example, @@ -183,55 +186,40 @@ %\end{verbatim} % % \section{Time Commands} -%\changes{v2.3}{1 May 2004}{Fixed minor bug in 'ampmtime. -%(or more specifically, changed the way 'ampmtime, 'xxivtime -% and 'oclock are defined.)}\changes{v2.51}{30 Jan 2007}{fixed bug in 'ampmtime between midnight and 1am} %\DescribeMacro{\currenttime} % The current time is displayed using the command %\verb"\currenttime". %\DescribeMacro{\settimeformat} -% The format can be changed using the declaration -%\verb"\settimeformat{"\meta{style}\verb+}+, -% where \meta{style} is the name of the format\footnote{% -% Note that the commands \texttt{\textbackslash xxivtime}, -%\texttt{\textbackslash ampmtime} and -% \texttt{\textbackslash oclock} are still available, -%\texttt{\textbackslash settimeformat} -% redefines \texttt{\textbackslash currenttime} to the command -%given by placing a backslash in front of \meta{style}. So -% \texttt{\textbackslash settimeformat\{xxivtime\}} sets -%\texttt{\textbackslash currenttime} -% to \texttt{\textbackslash xxivtime} and so on.}. Available -%formats are: +% The format can be changed using the declaration +%\cs{settimeformat}\marg{style}, where \meta{style} is the name of the +%format\footnote{Note that the commands \cs{xxivtime}, \cs{ampmtime} +%and \cs{oclock} are still available, \cs{settimeformat} redefines +%\cs{currenttime} to the command given by placing a backslash in front +%of \meta{style}. So \cs{settimeformat\{xxivtime\}} sets +%\cs{currenttime} to \cs{xxivtime} and so on.}. Available formats +%are: %\begin{description} %\item[xxivtime] Twenty-four hour time in the form 22:28 (Default) %\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.\footnote{Version -%2.43 fixed bug which caused an infinite loop on the hour.} -%\changes{v2.43}{23 Feb 2005}{Fixed bug in oclock time format} +%Twenty-Eight minutes past Ten in the afternoon. %\end{description} % % \DescribeMacro{\newtimeformat} -%\changes{v2.3}{1 May 2004}{'newtimeformat and 'settimeformat -%added} % New time formats can be defined using the command:\\[5pt] -%\verb"\newtimeformat{"\meta{name}\verb+}{+\meta{format}\verb!}!\\[5pt] +%\cs{newtimeformat}\marg{name}\marg{format}\\[5pt] % where \meta{name} is the name of the new format (used in -%\verb"\settimeformat"), and \meta{format} is how to format the +%\cs{settimeformat}), and \meta{format} is how to format the %time. Within \meta{format} you can use the counters %\texttt{HOUR} (number of hours after midnight), \texttt{MINUTE} %(number of minutes past the hour), \texttt{HOURXII} (number of -%hours after midnight/midday), \texttt{TOHOUR} (the next hour) -% and \texttt{TOMINUTE} (number of minutes to the next hour), and -%the corresponding commands: -% \verb"\THEHOUR", -%\verb"\THEMINUTE", -%\verb"\THEHOURXII", -%\verb"\THETOHOUR" and -%\verb"\THETOMINUTE". +%hours after midnight/midday), \texttt{TOHOUR} (the next hour) and +%\texttt{TOMINUTE} (number of minutes to the next hour), and the +%corresponding commands: \cs{THEHOUR}, \cs{THEMINUTE}, +%\cs{THEHOURXII}, \cs{THETOHOUR} and \cs{THETOMINUTE}. % -% For example, to define a new time format that uses a dot instead of a colon: +%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} @@ -241,20 +229,17 @@ %\currenttime %\end{verbatim} % -%\changes{v2.43}{25 Feb 2005}{added 'timeseparator}% %As from version 2.43, if you only want to change the separator, -%you can simply redefine \verb"\timeseparator" +%you can simply redefine \cs{timeseparator} %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. +%The \texttt{xxivtime} format will now work like the \texttt{dottime} +%format defined above. % % \section{Formating Dates} % \DescribeMacro{\pdfdate} -%\changes{v2.48}{4 May 2004}{Fixed bug in 'pdfdate} -%\changes{v2.32}{4 May 2004}{Fixed bug in 'pdfdate} -%\changes{v2.31}{1 May 2004}{'pdfdate added} % The command \verb"\pdfdate"\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 @@ -269,7 +254,7 @@ % /Author (Me) % /Title (A Sample Document) % /CreationDate (D:20040501215500) -% /ModificationDate (D:\pdfdate) +% /ModDate (D:\pdfdate) %} %\end{verbatim} % @@ -284,10 +269,6 @@ %\verb"\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. -%\changes{v2.1}{17 Dec 2003}{Fixed bug in 'shortmonthname which -%produced an error message in December} -%\changes{v2.1}{17 Dec 2003}{Changed 'fmtord to use -%'textsuperscript instead of \texttt{\^{}}} % % The day of the week is computed using the algorithm documented at % \url{http://userpages.wittenburg.edu/bshelburne/Comp150/DayOfWeek.htm}. @@ -296,12 +277,13 @@ % The following macros display the day of week for a given date: % % \noindent\DescribeMacro{\dayofweekname} -% \verb"\dayofweekname{"\meta{day}\verb!}{!\meta{month}\verb+}{+\meta{year}\verb:}: prints the +%\cs{dayofweekname}\marg{day}\marg{month}\marg{year} prints the % day of week for the specified date. For example, %\verb"\dayofweekname{31}{10}{2002}" % will produce the output: Thursday.\\ % \DescribeMacro{\shortdayofweekname} -% \verb"\shortdayofweekname{"\meta{day}\verb!}{!\meta{month}\verb+}{+\meta{year}\verb:}: prints the abbreviated name for the +%\cs{shortdayofweekname}\meta{day}\marg{month}\marg{year} prints the +%abbreviated name for the % day of week for the specified date. For example\\ % \verb"\shortdayofweekname{31}{10}{2002}"\\ % will produce the output: Thu. @@ -315,56 +297,45 @@ %\ifshowdow\dayofweekname{31}{10}{2002} \fi %\end{verbatim} % will only display the day of week if the \texttt{dayofweek} -%option was passed to \stynamefmt{datetime}. -% Alternatively, you can use David~Carlisle's \stynamefmt{ifthen} +%option was passed to \sty{datetime}. +% Alternatively, you can use David~Carlisle's \sty{ifthen} %package: %\begin{verbatim} %\ifthenelse{\boolean{showdow}}{\dayofweekname{31}{10}{2002} }{} %\end{verbatim} % %\noindent\DescribeMacro{\ordinaldate} -%\changes{v2.45}{23 May 2005}{'ordinaldate added} -%The command \verb!\ordinaldate{!\meta{number}\verb+}+ +%The command \cs{ordinaldate}\marg{number} %displays \meta{number} as a date-type ordinal. If the %current language is English, this will simply pass -%the argument to \verb!\ordinalnum! (defined in the -%\stynamefmt{fmtcount} package), +%the argument to \cs{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. % % \DescribeMacro{\formatdate} -% The macro \verb"\formatdate{"\meta{day}\verb!}{!\meta{month}\verb+}{+\meta{year}\verb:}:\footnote{Note the -% name change since version 1.1. The command name was changed -%from \texttt{\textbackslash thedate} -% to \texttt{\textbackslash formatdate} -% to avoid a name clash when using the \stynamefmt{seminar} class -%file.} formats -% the specified date according to the current format of -%\verb"\today"\footnote{To be more precise, \textbackslash -%\texttt{today} is defined to be \textbackslash -%\texttt{formatdate\{\textbackslash day\}\{\textbackslash month\}\{\textbackslash year\}} -% where \textbackslash \texttt{longdate} etc change the definition -%of \textbackslash \texttt{formatdate}}. (Arguments -% must all be integers.) For example, in combination with -%\verb"\longdate", the command\\ -%\verb"\formatdate{27}{9}{2004}"\\ -% will produce the output: Monday 27\textsuperscript{th} -%September, 2004. -%\changes{v1.1}{20 Apr 2002}{'thedate added (later changed to -%'formatdate)} -%\changes{v2.0}{30 Oct 2002}{Changed 'thedate to 'formatdate -% to avoid name conflict with \stynamefmt{seminar} class file.} -%\changes{v2.0}{30 Oct 2002}{Changed 'ordinal, -% 'ordinalstring, 'Ordinalstring, -% 'numberstring, 'Numberstring to take a -% \LaTeX\ counter as argument instead of a \TeX\ count register, -%to make them more consistent with 'arabic etc} +%The macro +%\cs{formatdate}\marg{day}\marg{month}\marg{year}\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.} formats the specified date according to +%the current format of \cs{today}\footnote{To be more precise, +%\cs{today} is defined to be +%\cs{formatdate\{\cs{day}\}\{\cs{month}\}\{\cs{year}\}} where +%\cs{longdate} etc change the definition of \cs{formatdate}}. +%(Arguments must all be integers.) For example, in combination with +%\verb"\longdate", the command +%\begin{verbatim} +%\formatdate{27}{9}{2004} +%\end{verbatim} +%will produce the output: Monday 27\textsuperscript{th} September, +%2004. % % \DescribeMacro{\twodigit} % You can ensure that a number is displayed with at least two %digits by using the command -%\verb"\twodigit{"\meta{num}\verb!}!\footnote{New to version 2.2}. +%\cs{twodigit}\marg{num}. % This is of use if you want to define your own date or time %formats. % @@ -372,20 +343,20 @@ % % \DescribeMacro{\newdateformat} % New date formats can be defined using the command:\\[5pt] -% \verb"\newdateformat{"\meta{name}\verb!}{!\meta{format}\verb+}+\\[5pt] +% \cs{newdateformat}\marg{name}\marg{format}\\[5pt] % 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 \verb"\THEDAY", -%\verb!\THEMONTH! -% and \verb"\THEYEAR" to represent the relevant day, month and +% argument \meta{format} you can use the commands \cs{THEDAY}, +%\cs{THEMONTH} +% and \cs{THEYEAR} to represent the relevant day, month and %year, or you can use the counters % \texttt{DAY}, \texttt{MONTH} and \texttt{YEAR} if you want to -%use \verb"\ordinal" etc. Once you have defined the -% new date format, you can then switch to it using the declaration \verb'\'\meta{name} +%use \cs{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 \verb"\today" and \verb!\formatdate! will +% subsequent calls to \cs{today} and \cs{formatdate} will %use your new format. -%\changes{v2.2}{27 Apr 2004}{'newdateformat added} % % For example, suppose you want to define a new date format called, % say, \texttt{mydate}, that will typeset the date in the form: @@ -394,8 +365,8 @@ %\begin{verbatim} %\newdateformat{mydate}{\THEDAY-\THEMONTH-\THEYEAR} %\end{verbatim} -% \verb"\newdateformat" will then define the declaration -%\verb!\mydate! which can be used to +%\cs{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: @@ -414,8 +385,8 @@ %Dash: 08-03-2002. %US: March 8\textsuperscript{th}, 2002. % -%Note that \verb"\THEDAY" etc and \texttt{DAY} etc have no real -%meaning outside \verb"\newdateformat" (this is why they +%Note that \cs{THEDAY} etc and \texttt{DAY} etc have no real +%meaning outside \cs{newdateformat} (this is why they %are in uppercase). Incidentally, the \texttt{dashdate} format %is not really necessary, as you can achieve this format %using: @@ -424,9 +395,9 @@ %\ddmmyyyydate %\end{verbatim} % -%Another note: in the above code, \verb'\ordinal' was +%Another note: in the above code, \cs{ordinal} was %used to illustrate the use of the \texttt{DAY} counter. It -%is better to use \verb'\ordinaldate' instead: +%is better to use \cs{ordinaldate} instead: %\begin{verbatim} %\newdateformat{usvardate}{% %\monthname[\THEMONTH] \ordinaldate{\THEDAY}, \THEYEAR} @@ -434,84 +405,79 @@ % %\section{Saving Dates} % -%\changes{v2.45}{1 May 2005}{added facility for 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}\par %\DescribeMacro{\newdate} -%\verb"\newdate{"\meta{name}\verb!}{!\meta{day}\verb+}{+% -%\meta{month}\verb'}{'\meta{year}\verb"}" +%\cs{newdate}\marg{name}\marg{day}\marg{month}\marg{year} % %This date can later be displayed using the same format as that -%used by \verb"\formatdate" using the command:\par +%used by \cs{formatdate} using the command:\par %\DescribeMacro{\displaydate} -%\verb"\displaydate{"\meta{name}\verb'}' +%\cs{displaydate}\marg{name} % %Individual elements of the date can be extracted using the %commands:\par %\DescribeMacro{\getdateday} -%\verb"\getdateday{"\meta{name}\verb'}'\par +%\cs{getdateday}\marg{name}\par %\DescribeMacro{\getdatemonth} -%\verb"\getdatemonth{"\meta{name}\verb'}'\par +%\cs{getdatemonth}\marg{name}\par %\DescribeMacro{\getdateyear} -%\verb"\getdateyear{"\meta{name}\verb'}' +%\cs{getdateyear}\marg{name} % %\section{Predefined Names} % -%The following commands are defined by the \stynamefmt{datetime} +%The following commands are defined by the \sty{datetime} %package: % %\begin{tabular}{ll} %\bfseries Command Name & \bfseries Default Value\\ -%\verb"\dateseparator"\changes{v2.43}{25 Feb 2005}{added -%'dateseparator} & \verb'/'\\ -%\verb"\timeseparator"\changes{v2.43}{25 Feb 2005}{added -%'timeseparator} & \verb':'\\ -%\verb"\amname" & \texttt{am}\\ -%\verb"\pmname" & \texttt{pm}\\ -%\verb"\amorpmname" & \verb'\amname' if morning, otherwise -%\verb!\pmname!\\ -%\verb"\amstring" & \texttt{in the morning}\\ -%\verb"\pmstring" & \texttt{in the afternoon}\\ -%\verb"\amorpmstring" & \verb!\amstring! if morning, otherwise -%\verb'\pmstring'\\ -%\verb"\halfpast" & \texttt{Half past}\\ -%\verb"\quarterpast" & \texttt{Quarter past}\\ -%\verb"\quarterto" & \texttt{Quarter to}\\ -%\verb"\noon" & \texttt{Noon}\\ -%\verb"\midnight" & \texttt{Midnight}\\ -%\verb"\oclockstring" & \texttt{O'Clock} +%\cs{dateseparator} & \verb'/'\\ +%\cs{timeseparator} & \verb':'\\ +%\cs{amname} & \texttt{am}\\ +%\cs{pmname} & \texttt{pm}\\ +%\cs{amorpmname} & \cs{amname} if morning, otherwise \cs{pmname}\\ +%\cs{amstring} & \texttt{in the morning}\\ +%\cs{pmstring} & \texttt{in the afternoon}\\ +%\cs{amorpmstring} & \cs{amstring} if morning, otherwise +%\cs{pmstring}\\ +%\cs{halfpast} & \texttt{Half past}\\ +%\cs{quarterpast} & \texttt{Quarter past}\\ +%\cs{quarterto} & \texttt{Quarter to}\\ +%\cs{noon} & \texttt{Noon}\\ +%\cs{midnight} & \texttt{Midnight}\\ +%\cs{oclockstring} & \texttt{O'Clock} %\end{tabular} % % \section{Package Options} % % The following options may be passed to this package:\\[10pt] % \begin{tabular}{@{\ttfamily}ll} -% long & make \verb"\today" produce long date\\ -% short & make \verb"\today" produce short date\\ -% ddmmyyyy & make \verb"\today" produce DD/MM/YYYY date\\ -% dmyyyy & make \verb"\today" produce D/M/YYYY date\\ -% ddmmyy & make \verb"\today" produce DD/MM/YY date\\ -% dmyy & make \verb"\today" produce D/M/YY date\\ -% text & make \verb"\today" produce text date\\ -% us & make \verb"\today" produce US style date\\ -% mmddyyyy & make \verb"\today" produce MM/DD/YYYY date\\ -% mdyyyy & make \verb"\today" produce M/D/YYYY date\\ -% mmddyy & make \verb"\today" produce MM/DD/YY date\\ -% mdyy & make \verb"\today" produce M/D/YY date\\ +% long & make \cs{today} produce long date\\ +% short & make \cs{today} produce short date\\ +% ddmmyyyy & make \cs{today} produce DD/MM/YYYY date\\ +% dmyyyy & make \cs{today} produce D/M/YYYY date\\ +% ddmmyy & make \cs{today} produce DD/MM/YY date\\ +% dmyy & make \cs{today} produce D/M/YY date\\ +% text & make \cs{today} produce text date\\ +% us & make \cs{today} produce US style date\\ +% mmddyyyy & make \cs{today} produce MM/DD/YYYY date\\ +% mdyyyy & make \cs{today} produce M/D/YYYY date\\ +% mmddyy & make \cs{today} produce MM/DD/YY date\\ +% mdyy & make \cs{today} produce M/D/YY date\\ % raise & make ordinal st,nd,rd,th appear as superscript\\ % level & make ordinal st,nd,rd,th appear level with rest of %text\\ -% dayofweek & make the day of week appear for \verb"\longdate", -%\verb!\shortdate! \\ -% & or \verb"\textdate"\\ +% dayofweek & make the day of week appear for \cs{longdate}, +%\cs{shortdate} \\ +% & or \cs{textdate}\\ % nodayofweek & don't display the day of week.\\ -% 24hr & make \verb"\currenttime" produce \texttt{xxivtime} +% 24hr & make \cs{currenttime} produce \texttt{xxivtime} %format\\ -% 12hr & make \verb"\currenttime" produce \texttt{ampmtime} +% 12hr & make \cs{currenttime} produce \texttt{ampmtime} %format\\ -% oclock & make \verb"\currenttime" produce \texttt{oclock} +% oclock & make \cs{currenttime} produce \texttt{oclock} %format\\ -% nodate & Don't redefine \verb"\today" or define the month or +% nodate & Don't redefine \cs{today} or define the month or %day of week commands\\ % & (useful if you only want the time commands or %\verb"\pdfdate") @@ -522,34 +488,52 @@ % %\section{Multilingual Support} % -%If the \stynamefmt{babel} package is called prior to -%\stynamefmt{datetime}, \verb"\date"\meta{lang} -%will be the default date format, -%where \meta{lang} is the current language. +%If you want to use the \sty{babel} package, you must load +%it \emph{before} you load the \sty{datetime} package. This +%is because the \sty{babel} \cs{date}\meta{lang} commands +%redefine \cs{today}, whereas the \sty{datetime} package +%redefines \cs{today} to use \cs{formatdate}, and the +%date formatting commands (such as \cs{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 \sty{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. % -%The commands \verb'\monthname' and \verb"\shortmonthname", +% +%The commands \cs{monthname} and \cs{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 \verb'\monthname'\meta{lang}. +%can use the command \cs{monthname}\meta{lang}. %For example, \verb"\monthnamefrench[6]" will produce the output: -%juin. +%juin. Note that \cs{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 \sty{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. % -%There is currently only limited multilingual support for -%\verb"\dayofweekname" and \verb!\shortdayofweekname! (just +%There is currently only \emph{limited} multilingual support for +%\cs{dayofweekname} and \cs{shortdayofweekname} (just %English, French, Portuguese, Spanish and German\footnote{thanks -%to Uwe Bieling for supplying the German names}). You can add support for -%other languages by defining the commands -%\verb'\dayofweeknameid'\meta{lang} and -%\verb'\shortdayofweeknameid'\meta{lang}. Note that these +%to Uwe Bieling for supplying the German names}). You can add support +%for other languages by defining the commands +%\cs{dayofweeknameid}\meta{lang} and +%\cs{shortdayofweeknameid}\meta{lang}. Note that these %commands only take \emph{one} argument which should be %a number from 1 to 7 indicating the day of the week. % %You can use the following as templates. Replace %\texttt{english} with the name of your language (as given -%by \verb'\languagename') and replace \texttt{Sunday} +%by \cs{languagename}) and replace \texttt{Sunday} %etc as appropriate: %\begin{verbatim} -%\providecommand{\dayofweeknameidenglish}[1]{% +%\providecommand*{\dayofweeknameidenglish}[1]{% %\ifcase#1\relax %\or Sunday% %\or Monday% @@ -560,7 +544,7 @@ %\or Saturday% %\fi} % -%\providecommand{\shortdayofweeknameidenglish}[1]{% +%\providecommand*{\shortdayofweeknameidenglish}[1]{% %\ifcase#1\relax %\or Sun% %\or Mon% @@ -572,19 +556,16 @@ %\fi} %\end{verbatim} %If you want them added to future versions of -%\stynamefmt{datetime}, please e-mail me the code. +%\sty{datetime}, please email me the code. % %\section{Configuration File} % -%\changes{v2.4}{25 Sept 2004}{provision for configuration file -%datetime.cfg} -%As from Version 2.4, the \stynamefmt{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: +%As from Version 2.4, the \sty{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} @@ -603,14 +584,14 @@ %\newdateformat{dashdate}{\twodigit{\THEDAY}-\twodigit{\THEMONTH}-\THEYEAR} %\dashdate %\end{verbatim} -%Whenever you use the \stynamefmt{datetime} package, it will now +%Whenever you use the \sty{datetime} package, it will now %use this format by default. % %\section{LaTeX2HTML styles} % -%\changes{v2.43}{25 Feb 2005}{Added LaTeX2HTML support}% -%\changes{v2.44}{3 Mar 2005}{Fixed minor bugs in Perl scripts} -%Version 2.43 and above of the \stynamefmt{datetime} bundle +%\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 \sty{datetime} bundle %supplies the LaTeX2HTML style file \texttt{datetime.perl}. %This file should be placed in a %directory searched by LaTeX2HTML. The following limitations @@ -628,7 +609,7 @@ %\end{verbatim} %This, I agree, is an unpleasant cludge. % -%\item The commands \verb"\monthname"\meta{language} are not +%\item The commands \cs{monthname}\meta{language} are not %implemented. % %\item Some of the languages are not implemented. @@ -639,16 +620,9 @@ % %\section{Troubleshooting} % -%There is a \stynamefmt{datetime} FAQ available at: +%There is a \sty{datetime} FAQ available at: %\url{http://theoval.cmp.uea.ac.uk/~nlct/latex/packages/faq/} % -% \section{Contact Details} -% Dr Nicola Talbot\\ -% School of Computing Sciences\\ -% University of East Anglia\\ -% Norwich. NR4 7TJ.\\ -% United Kingdom.\\ -% \url{http://theoval.cmp.uea.ac.uk/~nlct/} % % %\StopEventually{} @@ -662,66 +636,87 @@ % This section documents the code for \texttt{datetime.sty} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datetime}[2007/04/21 v2.52 Date Time Package] +\ProvidesPackage{datetime}[2007/08/20 v2.55 Date Time Package] % \end{macrocode} -%\texttt{fmtcount.sty} needs to be loaded here as it defines the command |\fmtord| which may be redefined later: +%\texttt{fmtcount.sty} needs to be loaded here as it defines the +% command \cs{fmtord} which may be redefined later: % \begin{macrocode} \RequirePackage{fmtcount} % \end{macrocode} -% Define a new conditional |\if@dt@nodate|. If it is true, -% |\today| will not be redefined, nor will -% |\monthname|, |\shortmonthname|, |\dayofweek| and |\shortdayofweek| be defined. +%\begin{macro}{\if@dtl@nodate} +% Define a new conditional \cs{if@dt@nodate}. If it is true, +% \cs{today} will not be redefined, nor will +% \cs{monthname}, \cs{shortmonthname}, \cs{dayofweek} and +% \cs{shortdayofweek} be defined. % Set it to false. % \begin{macrocode} \newif\if@dt@nodate \@dt@nodatefalse % \end{macrocode} -% Define the character used to separate the numbers in the formats defined by -% |\ddmmyyyy| etc +%\end{macro} +%\begin{macro}{\dateseparator} +% Define the character used to separate the numbers in the formats +% defined by \cs{ddmmyyyy} etc +%\changes{2.43}{2005/02/25}{new} % \begin{macrocode} \newcommand{\dateseparator}{/} % \end{macrocode} -% Define switch to determine whether to enable multilingual support.% -%\changes{v2.49}{5 Dec 2006}{check to see if babel package is -%loaded instead of testing 'languagename (following suggestions on -% comp.text.tex)} +%\end{macro} +%\begin{macro}{\if@dt@multilingual} +% Define switch to determine whether to enable multilingual support. +% This check to see if babel package is +% loaded instead of testing 'languagename (following suggestions on +% comp.text.tex) +%\changes{v2.49}{5 Dec 2006}{checks if babel package has been loaded} % Note that babel must be loaded \emph{before} datetime, otherwise -% it will change the definitions of |\date|\meta{lang}. +% it will change the definitions of \cs{date}\meta{lang}. +%\changes{2.55}{2007/08/20}{fixed bug preventing multilingual support} % \begin{macrocode} \newif\if@dt@multilingual \@ifpackageloaded{babel}{% -\@dt@multilingualtrue}{\@dt@multilingualfalse} +\@dt@multilingualtrue}{% \@ifpackageloaded{ngerman}{% -\@dt@multilingualtrue}{\@dt@multilingualfalse} +\@dt@multilingualtrue}{\@dt@multilingualfalse}} % \end{macrocode} -% Define |\ordinaldate|. This is needed because some +%\end{macro} +% Define the \cs{ordinaldate}\meta{language} macros. These are +% needed because some % languages only use an ordinal for the first day of % the month (such as french). This isn't really needed -% here, but the LaTeX2HTML style file needs this command. +% here, but the LaTeX2HTML style file needs \cs{ordinaldate}. +%\begin{macro}{\ordinaldateenglish} % English version: % \begin{macrocode} -\newcommand{\ordinaldateenglish}[1]{\ordinalnum{#1}} +\newcommand*{\ordinaldateenglish}[1]{\ordinalnum{#1}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\ordinaldatewelsh} % Welsh version: % \begin{macrocode} -\newcommand{\ordinaldatewelsh}[1]{% +\newcommand*{\ordinaldatewelsh}[1]{% #1\ifnum#1=1\/\textsuperscript{a\~n}\fi} % \end{macrocode} +%\end{macro} +%\begin{macro}{\ordinaldatebreton} % Breton version: % \begin{macrocode} -\newcommand{\ordinaldatebreton}[1]{% +\newcommand*{\ordinaldatebreton}[1]{% #1\ifnum#1=1\/\textsuperscript{a\~n}\fi} % \end{macrocode} +%\end{macro} +%\begin{macro}{\ordinaldatefrench} % French: % \begin{macrocode} -\newcommand{\ordinaldatefrench}[1]{% +\newcommand*{\ordinaldatefrench}[1]{% #1\ifnum#1=1\ier\fi} % \end{macrocode} -% Let \verb|\ordinaldate| be language dependent. If -% |\ordinaldate|\meta{language} is not defined, then just display +%\end{macro} +%\begin{macro}{\ordinaldate} +% If |\ordinaldate|\meta{language} is not defined, then just display % the number. +%\changes{2.45}{2005/05/23}{new} % \begin{macrocode} -\newcommand{\ordinaldate}[1]{% +\newcommand*{\ordinaldate}[1]{% \if@dt@multilingual \@ifundefined{ordinaldate\languagename}{#1}{% \csname ordinaldate\languagename\endcsname{#1}}% @@ -729,28 +724,39 @@ \ordinalnum{#1}% \fi} % \end{macrocode} +%\end{macro} +%\begin{macro}{\ier} % In case \verb|\ier| hasn't been defined:% -%\changes{v2.47}{27 Oct 2005}{'ier defined if it doesn't +%\changes{v2.47}{27 Oct 2005}{defined if it doesn't % already exist} % \begin{macrocode} -\providecommand{\ier}{\textsuperscript{er}} +\providecommand*{\ier}{\textsuperscript{er}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\ifshowdow} % Now define the declarations that redefine |\formatdate| as they % are used by the package options. Need a conditional to determine % whether or not to show the day of week name. % \begin{macrocode} -\newif\ifshowdow % show the day of week if true +\newif\ifshowdow % \end{macrocode} +%\end{macro} +%\changes{1.1}{2002/04/20}{\cs{thedate} added} +%\begin{macro}{\formatdate} % Initially |\formatdate| does nothing. It will be redefined later. +%\changes{2.0}{2002/10/30}{changes \cs{thedate} to \cs{formatdate} +% to avoid name conflict with other packages/class files.} % \begin{macrocode} \providecommand*{\formatdate}[3]{} % \end{macrocode} +%\end{macro} % Provide counters to store the specified date: % \begin{macrocode} \newcount\@day \newcount\@month \newcount\@year % \end{macrocode} +%\begin{macro}{\longdate} % Long date format. (This is the default in the absense of package % options, babel and datetime.cfg settings.) % \begin{macrocode} @@ -760,6 +766,8 @@ \@day=##1\relax\@month=##2\relax\@year=##3\relax \ordinaldate{\the\@day}\ \monthname[\@month], \the\@year}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\shortdate} % Abbreviated version of above % \begin{macrocode} \DeclareRobustCommand*{\shortdate}{% @@ -768,12 +776,17 @@ \@day=##1\relax\@month=##2\relax\@year=##3\relax \ordinaldate{\the\@day}\ \shortmonthname[\@month], \the\@year}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\twodigit} % Define |\twodigit| to display a number as two digits. \LaTeX\ % already defines the internal command |\two@digits|, but need % a command that can be used in |\newdateformat| in the document. +%\changes{2.2}{2004/04/27}{new} % \begin{macrocode} \let\twodigit\two@digits % \end{macrocode} +%\end{macro} +%\begin{macro}{\ddmmyyyydate} % Day/month/year format. (Day and month displayed as two digits, % year displayed as is.) % \begin{macrocode} @@ -783,6 +796,8 @@ \twodigit\@day\dateseparator \twodigit\@month\dateseparator \the\@year}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\dmyyyydate} % Day/month/year format. (Numbers all displayed as is.) % \begin{macrocode} \DeclareRobustCommand*{\dmyyyydate}{% @@ -790,6 +805,8 @@ \@day=##1\relax\@month=##2\relax\@year=##3\relax \the\@day\dateseparator \the\@month\dateseparator \the\@year}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\ddmmyydate} % Day/month/year format. (All numbers displayed as two digits.) % \begin{macrocode} \DeclareRobustCommand*{\ddmmyydate}{\renewcommand*{\formatdate}[3]{% @@ -799,6 +816,8 @@ \twodigit\@day\dateseparator \twodigit\@month\dateseparator \twodigit\@dtctr}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\dmyydate} % Day/month/year format. (Day and month displayed as is, year % abbreviated to two digits.) % \begin{macrocode} @@ -808,7 +827,9 @@ \@modulo{\@dtctr}{100}% \the\@day\dateseparator \the\@month\dateseparator \twodigit\@dtctr}} % \end{macrocode} -% Full textual date. +%\end{macro} +%\begin{macro}{\textdate} +% Full textual date (English). % \begin{macrocode} \DeclareRobustCommand*{\textdate}{% \renewcommand*{\formatdate}[3]{% @@ -818,6 +839,8 @@ \Numberstringnum{\@year}% }} % \end{macrocode} +%\end{macro} +%\begin{macro}{\usdate} % US format (as per original definition of |\today|) % \begin{macrocode} \DeclareRobustCommand*{\usdate}{% @@ -825,6 +848,8 @@ \@day=##1\relax\@month=##2\relax\@year=##3\relax \monthname[\@month]\ \the\@day, \the\@year}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\mmddyyyydate} % Month/day/year format. (Month and day displayed as two digits, % year displayed as is.) % \begin{macrocode} @@ -834,6 +859,8 @@ \twodigit\@month\dateseparator \twodigit\@day\dateseparator \the\@year}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\mdyyyydate} % Month/day/year format. (All numbers displayed as is.) % \begin{macrocode} \DeclareRobustCommand*{\mdyyyydate}{% @@ -841,6 +868,8 @@ \@day=##1\relax\@month=##2\relax\@year=##3\relax \the\@month\dateseparator \the\@day\dateseparator \the\@year}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\mmddyydate} % Month/day/year format. (All numbers displayed with two digits.) % \begin{macrocode} \DeclareRobustCommand*{\mmddyydate}{\renewcommand*{\formatdate}[3]{% @@ -850,6 +879,8 @@ \twodigit\@month\dateseparator \twodigit\@day\dateseparator \twodigit\@dtctr}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\mdyydate} % Month/day/year format. (Month and day displayed as is, year % abbreviated to two digits.) % \begin{macrocode} @@ -859,30 +890,39 @@ \@modulo{\@dtctr}{100}% \the\@month\dateseparator \the\@day\dateseparator \twodigit\@dtctr}} % \end{macrocode} -% (New to v.2.45) Define commands to save dates +%\end{macro} +%\begin{macro}{\newdate} +% Define commands to save dates % and later format them. Store a given date: +%\changes{2.45}{2005/05/01}{new} % \begin{macrocode} -\newcommand{\newdate}[4]{% +\newcommand*{\newdate}[4]{% \@ifundefined{date@#1@y}{% \@namedef{date@#1@d}{#2}% \@namedef{date@#1@m}{#3}% \@namedef{date@#1@y}{#4}}{% \PackageError{datetime}{Date `#1' already defined}{}}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\getdateyear} % Display year from previously stored date % \begin{macrocode} -\newcommand{\getdateyear}[1]{% +\newcommand*{\getdateyear}[1]{% \@ifundefined{date@#1@y}{% \PackageError{datetime}{Date `#1' not defined}{}}{% \csname date@#1@y\endcsname}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\getdatemonth} % Display month from previously stored date % \begin{macrocode} -\newcommand{\getdatemonth}[1]{% +\newcommand*{\getdatemonth}[1]{% \@ifundefined{date@#1@m}{% \PackageError{datetime}{Date `#1' not defined}{}}{% \csname date@#1@m\endcsname}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\getdateday} % Display day from previously stored date % \begin{macrocode} \newcommand{\getdateday}[1]{% @@ -890,35 +930,48 @@ \PackageError{datetime}{Date `#1' not defined}{}}{% \csname date@#1@d\endcsname}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\displaydate} % Display a previously stored date using current date format % \begin{macrocode} -\newcommand{\displaydate}[1]{% +\newcommand*{\displaydate}[1]{% \@ifundefined{date@#1@y}{% \PackageError{datetime}{Date `#1' not defined}{}}{% \formatdate{\csname date@#1@d\endcsname}{% \csname date@#1@m\endcsname}{% \csname date@#1@y\endcsname}}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\currenttime} % (New to v2.3) Define |\currenttime| which will print the % time according to the current format. Set it to 24hr time by default % \begin{macrocode} \DeclareRobustCommand*{\currenttime}{\xxivtime} % \end{macrocode} +%\end{macro} +%\begin{macro}{\timeseparator} +%\changes{2.43}{2005/02/25}{new} % Define separator for numerical times: % \begin{macrocode} -\newcommand{\timeseparator}{:} +\newcommand*{\timeseparator}{:} % \end{macrocode} +%\end{macro} +%\begin{macro}{\settimeformat} % Switch to specified time format: +%\changes{2.3}{2004/05/01}{new} % \begin{macrocode} -\providecommand{\settimeformat}[1]{% +\providecommand*{\settimeformat}[1]{% \DeclareRobustCommand*\currenttime{\csname#1\endcsname}} % \end{macrocode} +%\end{macro} % Set defaults: % \begin{macrocode} \longdate \showdowtrue % \end{macrocode} % Load in specifications from configuration file: +%\changes{2.4}{2004/09/25}{added provision for configuration file +%datetime.cfg} % \begin{macrocode} \InputIfFileExists{datetime.cfg}{\PackageInfo{datetime}{% Loading local datetime configurations}}{% @@ -1008,10 +1061,17 @@ settings}} % (Only define this command if @dt@nodate is false) % \begin{macrocode} \if@dt@nodate +% \end{macrocode} +% The |nodate| option was used, so just print informative message, +% and do nothing else. +% \begin{macrocode} \PackageInfo{datetime}{option "nodate" used, so not defining \string\monthname} \else -\providecommand{\monthnameenglish}[1][\month]{% +% \end{macrocode} +%\begin{macro}{\monthnameenglish} +% \begin{macrocode} +\providecommand*{\monthnameenglish}[1][\month]{% \@orgargctr=#1\relax \ifcase\@orgargctr \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month @@ -1032,10 +1092,12 @@ numbers should go from 1 (January) to 12 (December)}% Month numbers should go from 1 (January) to 12 (December)}% \fi} % \end{macrocode} +%\end{macro} +%\begin{macro}{\monthname} %Define \verb|\monthname| to be language dependent. If there %is no \verb|\monthname|\meta{language}, defaults to English. % \begin{macrocode} -\newcommand{\monthname}[1][\month]{% +\newcommand*{\monthname}[1][\month]{% \if@dt@multilingual \@ifundefined{monthname\languagename}{% \PackageWarning{datetime}{No month names provided for language @@ -1045,6 +1107,7 @@ Month numbers should go from 1 (January) to 12 (December)}% \monthnameenglish[#1]% \fi} % \end{macrocode} +%\end{macro} % End of |\if@dt@nodate| else part: % \begin{macrocode} \fi @@ -1053,10 +1116,19 @@ Month numbers should go from 1 (January) to 12 (December)}% % (Again, only do this if @dt@nodate is false) % \begin{macrocode} \if@dt@nodate +% \end{macrocode} +% The |nodate| option was used, so just print informative message, +% and do nothing else. +% \begin{macrocode} \PackageInfo{datetime}{option "nodate" used, so not defining \protect\shortmonthname} \else -\providecommand{\shortmonthnameenglish}[1][\month]{% +% \end{macrocode} +%\begin{macro}{\shortmonthnameenglish} +%\changes{2.1}{2003/12/17}{fixed bug producing an error message +% in December} +% \begin{macrocode} +\providecommand*{\shortmonthnameenglish}[1][\month]{% \@orgargctr=#1\relax \ifcase\@orgargctr \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month @@ -1078,9 +1150,12 @@ numbers should go from 1 (jan) to 12 (dec)}% numbers should go from 1 (jan) to 12 (dec)}% \fi} % \end{macrocode} -% Similarly for abbreviated month names. +%\end{macro} +%\begin{macro}{\shortmonthname} +%Define \verb|\shortmonthname| to be language dependent. If there +%is no \verb|\shortmonthname|\meta{language}, defaults to English. % \begin{macrocode} -\newcommand{\shortmonthname}[1][\month]{% +\newcommand*{\shortmonthname}[1][\month]{% \if@dt@multilingual \@ifundefined{shortmonthname\languagename}{% \PackageWarning{datetime}{No abbreviated month name defined for @@ -1090,15 +1165,21 @@ language '\languagename', using full version instead}% \else \shortmonthnameenglish[#1]% \fi} +% \end{macrocode} +%\end{macro} +% End of |\if@dt@nodate| else part: +% \begin{macrocode} \fi % \end{macrocode} % Define macros needed to compute the weekday % (Again, only do this if @dt@nodate is false) +%\begin{macro}{\ifleapyear} % Need to define |\ifleapyear| regardless of @dt@nodate otherwise \LaTeX\ won't % match |\ifleapyear| with |\fi| % \begin{macrocode} \newif\ifleapyear % \end{macrocode} +%\end{macro} % Define temporary counter for arithmetic. % \begin{macrocode} \newcount\@dtctr @@ -1116,7 +1197,7 @@ language '\languagename', using full version instead}% % Syntax: \verb|testifleapyear{|\meta{year}\verb|}| sets % conditional \verb|\ifleapyear|. % \begin{macrocode} -\providecommand{\testifleapyear}[1]{% +\providecommand*{\testifleapyear}[1]{% \leapyearfalse \@year=#1\relax \@dtctr=\@year @@ -1138,12 +1219,17 @@ language '\languagename', using full version instead}% \fi } % \end{macrocode} -% Compute the day of year. Result will be stored in \verb|\dayofyear| -% Syntax: |\computedayofyear{|\meta{day}|}{|\meta{month}|}{|\meta{year}|}| +%\begin{macro}{\dayofyear} +% Count register in which to store the day of the year. % \begin{macrocode} \newcount\dayofyear - -\providecommand{\computedayofyear}[3]{% +% \end{macrocode} +%\end{macro} +%\begin{macro}{\computedayofyear} +% \cs{computedayofyear}\marg{day}\marg{month}\marg{year}\par +% Computes the day of year. Result will be stored in \verb|\dayofyear| +% \begin{macrocode} +\providecommand*{\computedayofyear}[3]{% \testifleapyear{#3}% \dayofyear=0\relax \@day=#1\relax \@month=#2\relax \@year=#3\relax @@ -1162,7 +1248,7 @@ language '\languagename', using full version instead}% \or \advance\dayofyear by 334\relax \else \PackageError{datetime}{Invalid month number}{The second argument to -\string\computedayofyear \space should lie in the range 1-12} +\string\computedayofyear \space should lie in the range 1-12}% \fi \ifnum\@month>2\relax \ifleapyear\advance\dayofyear by 1\relax\fi @@ -1170,12 +1256,19 @@ language '\languagename', using full version instead}% \advance\dayofyear by \@day\relax } % \end{macrocode} -% Compute the day of week index. Stored in |\dayofweek|. -% Syntax: |\computedayofweek{|\meta{day}|}{|\meta{month}|}{|\meta{year}|}| +%\end{macro} +%\begin{macro}{\dayofweek} +% Count register in which to store the day of the week. % \begin{macrocode} \newcount\dayofweek - -\providecommand{\computedayofweek}[3]{% +% \end{macrocode} +%\end{macro} +%\begin{macro}{\computedayofweek} +% \cs{computedayofweek}\marg{day}\marg{month}\marg{year}\par +% Computes the day of week index. The result is stored in +% |\dayofweek|. +% \begin{macrocode} +\providecommand*{\computedayofweek}[3]{% \computedayofyear{#1}{#2}{#3}% \@dtctr=#3\relax \advance\@dtctr by -1901\relax @@ -1190,9 +1283,11 @@ language '\languagename', using full version instead}% \@modulo{\dayofweek}{7}% \advance\dayofweek by 1\relax} % \end{macrocode} +%\end{macro} +%\begin{macro}{\dayofweeknameidenglish} % Given the day of week index, print associated the English name. % \begin{macrocode} -\providecommand{\dayofweeknameidenglish}[1]{% +\providecommand*{\dayofweeknameidenglish}[1]{% \ifcase#1\relax \or Sunday% \or Monday% @@ -1203,11 +1298,13 @@ language '\languagename', using full version instead}% \or Saturday% \fi} % \end{macrocode} +%\end{macro} +%\begin{macro}{\dayofweeknameid} % Given the day of week index, print the associated name in the % current language. If there is none defined for that language % default to English. % \begin{macrocode} -\providecommand{\dayofweeknameid}[1]{% +\providecommand*{\dayofweeknameid}[1]{% \if@dt@multilingual \@ifundefined{dayofweeknameid\languagename}{% \ifthenelse{\equal{\languagename}{nohyphenation}}{}{% @@ -1220,21 +1317,27 @@ language '\languagename', using full version instead}% \fi } % \end{macrocode} +%\end{macro} +%\begin{macro}{\dayofweekname} % Print the day of week name for the specified date. % \begin{macrocode} -\providecommand{\dayofweekname}[3]{% +\providecommand*{\dayofweekname}[3]{% \computedayofweek{#1}{#2}{#3}% \dayofweeknameid{\dayofweek}% } % \end{macrocode} +%\end{macro} +%\begin{macro}{\thisdayofweekname} % Print today's day of week name. % \begin{macrocode} -\providecommand{\thisdayofweekname}{% +\providecommand*{\thisdayofweekname}{% \dayofweekname{\day}{\month}{\year}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\shortdayofweeknameidenglish} % As before, but for abbreviated day of week name. English version: % \begin{macrocode} -\providecommand{\shortdayofweeknameidenglish}[1]{% +\providecommand*{\shortdayofweeknameidenglish}[1]{% \ifcase#1\relax \or Sun% \or Mon% @@ -1245,9 +1348,11 @@ language '\languagename', using full version instead}% \or Sat% \fi} % \end{macrocode} +%\end{macro} +%\begin{macro}{\shortdayofweekname} % Language dependant version: % \begin{macrocode} -\providecommand{\shortdayofweekname}[3]{% +\providecommand*{\shortdayofweekname}[3]{% \computedayofweek{#1}{#2}{#3}% \if@dt@multilingual \@ifundefined{shortdayofweeknameid\languagename}{% @@ -1261,28 +1366,41 @@ language '\languagename', defaulting to long version}}% \fi } % \end{macrocode} +%\end{macro} +%\begin{macro}{\thisshortdayofweekname} % Today's week day name, abbreviated: % \begin{macrocode} -\providecommand{\thisshortdayofweekname}{% +\providecommand*{\thisshortdayofweekname}{% \dayofweekname{\day}{\month}{\year}} % \end{macrocode} +%\end{macro} % End of |\if@dt@nodate| else part. % \begin{macrocode} \fi % \end{macrocode} +%\begin{macro}{\today} % Redefine |\today| so that it uses |\formatdate|. % (Only do this if @dt@nodate is false) +%\changes{2.46}{2005/09/30}{defined using \cs{DeclareRobustCommand}} +%\changes{2.41}{2004/10/22}{defined using \cs{providecommand}} % \begin{macrocode} \if@dt@nodate \else \DeclareRobustCommand*{\today}{\formatdate{\day}{\month}{\year}} \fi % \end{macrocode} +%\end{macro} %Check to see if babel package has redefined |\today|. +%\changes{2.53}{11 June 2007}{added check for \cs{dateUKenglish} and +%\cs{dateUSenglish}} +%\changes{2.54}{15 June 2007}{added check for \cs{datebritish}} % \begin{macrocode} \if@dt@nodate \else \@ifundefined{dateenglish}{}{\let\dateenglish\longdate} +\@ifundefined{dateUKenglish}{}{\input{dt-UKenglish.def}} +\@ifundefined{dateUSenglish}{}{\input{dt-USenglish.def}} +\@ifundefined{datebritish}{}{\input{dt-british.def}} \@ifundefined{dateaustrian}{}{\input{dt-austrian.def}} \@ifundefined{datebahasa}{}{\input{dt-bahasa.def}} \@ifundefined{datebasque}{}{\input{dt-basque.def}} @@ -1327,6 +1445,7 @@ language '\languagename', defaulting to long version}}% \@ifundefined{datewelsh}{}{\input{dt-welsh.def}} \fi % \end{macrocode} +% % Define |\newdateformat| which defines a declaration that redefines |\formatdate| so that % it uses |\dateformat|. |\dateformat| takes four arguments, the first defines the format % the last three arguments are the three arguments that effectively get passed to |\formatdate|. @@ -1343,9 +1462,9 @@ defining \string\newdateformat} % used in the argument to |\newdateformat|. This is done partly to % assist the \LaTeX2HTML version. % \begin{macrocode} -\providecommand\THEDAY{\the\@day} -\providecommand\THEMONTH{\the\@month} -\providecommand\THEYEAR{\the\@year} +\providecommand*\THEDAY{\the\@day} +\providecommand*\THEMONTH{\the\@month} +\providecommand*\THEYEAR{\the\@year} % \end{macrocode} % Simulate a \LaTeX\ counter. % \begin{macrocode} @@ -1353,12 +1472,16 @@ defining \string\newdateformat} \let\c@MONTH=\@month \let\c@YEAR=\@year % \end{macrocode} +%\begin{macro}{\dateformat} % Format the given date in the given format. % \begin{macrocode} -\providecommand{\dateformat}[4]{% +\providecommand*{\dateformat}[4]{% \@day=#2\relax\@month=#3\relax\@year=#4\relax#1} % \end{macrocode} +%\end{macro} +%\begin{macro}{\newdateformat} % Provide a means to define a new date format. +%\changes{2.2}{2004/04/27}{new} % \begin{macrocode} \providecommand{\newdateformat}[2]{% \@ifundefined{#1}{% @@ -1368,10 +1491,12 @@ defining \string\newdateformat} \textbackslash#1 already defined}{You will need to give your new date format a different name}}} % \end{macrocode} +%\end{macro} % End of |\if@no@date| else part: % \begin{macrocode} \fi % \end{macrocode} +% % \subsubsection{Time Macros} % Define a command to create a new time format, similar to the new % date format. Again this is done in a way that makes it easier to @@ -1391,9 +1516,11 @@ give your new date format a different name}}} \def\THETOHOUR{\the\c@TOHOUR} \def\THETOMINUTE{\the\c@TOMINUTE} % \end{macrocode} +%\begin{macro}{\newtimeformat} % Provide a means to define a new time format. +%\changes{2.3}{2004/05/01}{new} % \begin{macrocode} -\providecommand{\newtimeformat}[2]{% +\providecommand*{\newtimeformat}[2]{% \@ifundefined{#1}{% \expandafter\def\csname#1\endcsname{% \c@HOUR=\time% @@ -1416,25 +1543,37 @@ give your new date format a different name}}} You can't create a new time format called "#1" as the command \textbackslash#1 already exists}}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\xxivtime} % Define commands to print the current time. Twenty-four hour time: % \begin{macrocode} \newtimeformat{xxivtime}{% \twodigit\THEHOUR\timeseparator\twodigit\THEMINUTE} % \end{macrocode} +%\end{macro} +%\begin{macro}{\ampmtime} % 12-hour time: +%\changes{2.3}{2004/05/01}{fixed minor bug} +%\changes{2.51}{2007/01/30}{fixed bug between midnight and 1am} % \begin{macrocode} \newtimeformat{ampmtime}{% -\ifthenelse{\value{HOUR}=0}{12}{\THEHOURXII}\timeseparator\twodigit\THEMINUTE +\ifthenelse{\value{HOUR}=0}{12}{\THEHOURXII}\timeseparator +\twodigit\THEMINUTE \ifthenelse{\value{HOUR}<12}{\amname}{% \ifthenelse{\time=720}{ \noon}{\pmname}}} % \end{macrocode} +%\end{macro} % Textual time: -% |\hourstring| will print |\midnight| if || is 0, otherwise -% will do |\Numberstring|. +%\begin{macro}{\hourstring} +% \cs{hourstring}\marg{count} will print |\midnight| if +% \meta{count} is 0, otherwise will do \cs{Numberstring}\marg{count}. % \begin{macrocode} \newcommand*{\hourstring}[1]{% \ifthenelse{\value{#1}=0}{\midnight}{\Numberstring{#1}}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\oclock} +%\changes{2.43}{2005/02/23}{fixed bug causing an infinite loop on the hour} % \begin{macrocode} \newtimeformat{oclock}{\ifthenelse{\time=0 \or \time=720}{% % \end{macrocode} @@ -1475,36 +1614,86 @@ past \hourstring{HOURXII}}{% % \begin{macrocode} \ifthenelse{\value{TOHOUR}=0}{}{\ \pmstring}}}} % \end{macrocode} +%\end{macro} % Define textual strings used in the above. +%\begin{macro}{\amname} +% \begin{macrocode} +\providecommand*{\amname}{am} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\pmname} % \begin{macrocode} -\providecommand{\amname}{am} -\providecommand{\pmname}{pm} -\providecommand{\amorpmname}{% +\providecommand*{\pmname}{pm} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\amorpmname} +% \begin{macrocode} +\providecommand*{\amorpmname}{% \ifthenelse{\value{HOUR}>12}{\pmname}{\amname}} -\providecommand{\amstring}{in the morning} -\providecommand{\pmstring}{in the afternoon} -\providecommand{\amorpmstring}{% +% \end{macrocode} +%\end{macro} +%\begin{macro}{\amstring} +% \begin{macrocode} +\providecommand*{\amstring}{in the morning} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\pmstring} +% \begin{macrocode} +\providecommand*{\pmstring}{in the afternoon} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\amorpmstring} +% \begin{macrocode} +\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} % \end{macrocode} +%\end{macro} +%\begin{macro}{\halfpast} +% \begin{macrocode} +\providecommand*{\halfpast}{Half past} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\quarterpast} +% \begin{macrocode} +\providecommand*{\quarterpast}{Quarter past} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\quarterto} +% \begin{macrocode} +\providecommand*{\quarterto}{Quarter to} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\noon} +% \begin{macrocode} +\providecommand*{\noon}{Noon} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\midnight} +% \begin{macrocode} +\providecommand*{\midnight}{Midnight} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\oclockstring} +% \begin{macrocode} +\providecommand*{\oclockstring}{O'Clock} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\pdfdate} % Finally create command that will typeset the date in PDF format % e.g. 20040501215500. This is defined regardless of |\if@no@date| % as it's provided for use in |\pdfinfo|. Initially |\pdfdate| is set % to the year. +%\changes{2.31}{2004/05/01}{new} +%\changes{2.32}{2004/05/04}{fixed bug} % \begin{macrocode} -\toksdef\dt@a=0 \toksdef\dt@b=2 +\newtoks\dt@a \newtoks\dt@b \edef\pdfdate{\the\year} % \end{macrocode} % Append the month % \begin{macrocode} \dt@b=\expandafter{\pdfdate} \dt@a=\expandafter{\the\month} -\ifnum\month<10 +\ifnum\month<10\relax \edef\pdfdate{\the\dt@b0\the\dt@a} \else \edef\pdfdate{\the\dt@b\the\dt@a} @@ -1514,7 +1703,7 @@ past \hourstring{HOURXII}}{% % \begin{macrocode} \dt@b=\expandafter{\pdfdate} \dt@a=\expandafter{\the\day} -\ifnum\day<10 +\ifnum\day<10\relax \edef\pdfdate{\the\dt@b0\the\dt@a} \else \edef\pdfdate{\the\dt@b\the\dt@a} @@ -1538,7 +1727,7 @@ past \hourstring{HOURXII}}{% \@modulo{\@dtctr}{60}% \dt@b=\expandafter{\pdfdate} \dt@a=\expandafter{\the\@dtctr} -\ifnum\@dtctr<10 +\ifnum\@dtctr<10\relax \edef\pdfdate{\the\dt@b0\the\dt@a} \else \edef\pdfdate{\the\dt@b\the\dt@a} @@ -1551,6 +1740,7 @@ past \hourstring{HOURXII}}{% \dt@b=\expandafter{\pdfdate} \edef\pdfdate{\the\dt@b\the\dt@a} % \end{macrocode} +%\end{macro} %\iffalse % \begin{macrocode} % @@ -1820,6 +2010,28 @@ Month numbers should go from 1 (Genver) to 12 (Kerzu)}% %\fi %\iffalse % \begin{macrocode} +%<*dt-british.def> +% \end{macrocode} +%\fi +%\subsubsection{british} +% Identify file +% \begin{macrocode} +\ProvidesFile{dt-british.def}[2007/06/15] +% \end{macrocode} +\let\datebritish\longdate + +\let\monthnamebritish\monthnameenglish +\let\shortmonthnamebritish\shortmonthnameenglish + +\let\dayofweeknameidbritish\dayofweeknameidenglish +\let\shortdayofweeknameidbritish\shortdayofweeknameidenglish +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} %<*dt-bulgarian.def> % \end{macrocode} %\fi @@ -3688,6 +3900,28 @@ Month numbers should go from 1 to 12}% %\fi %\iffalse % \begin{macrocode} +%<*dt-UKenglish.def> +% \end{macrocode} +%\fi +%\subsubsection{UKenglish} +% Identify file +% \begin{macrocode} +\ProvidesFile{dt-UKenglish.def}[2007/06/11] +% \end{macrocode} +\let\dateUKenglish\longdate + +\let\monthnameUKenglish\monthnameenglish +\let\shortmonthnameUKenglish\shortmonthnameenglish + +\let\dayofweeknameidUKenglish\dayofweeknameidenglish +\let\shortdayofweeknameidUKenglish\shortdayofweeknameidenglish +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} %<*dt-ukraineb.def> % \end{macrocode} %\fi @@ -3733,6 +3967,28 @@ Month numbers should go from 1 to 12}% %\fi %\iffalse % \begin{macrocode} +%<*dt-USenglish.def> +% \end{macrocode} +%\fi +%\subsubsection{USenglish} +% Identify file +% \begin{macrocode} +\ProvidesFile{dt-USenglish.def}[2007/06/11] +% \end{macrocode} +\let\dateUSenglish\usdate + +\let\monthnameUSenglish\monthnameenglish +\let\shortmonthnameUSenglish\shortmonthnameenglish + +\let\dayofweeknameidUSenglish\dayofweeknameidenglish +\let\shortdayofweeknameidUSenglish\shortdayofweeknameidenglish +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} %<*dt-usorbian.def> % \end{macrocode} %\fi @@ -3861,1990 +4117,5 @@ Month numbers should go from 1 to 12}% % % \end{macrocode} %\fi -%\iffalse -% \begin{macrocode} -%<*datetime.perl> -% \end{macrocode} -%\fi -% \begin{macrocode} -# File : datetime.perl -# Author : Nicola Talbot -# Date : 21 Apr 2007 -# Version : 1.03 -# Description : LaTeX2HTML implementation of datetime package. - -# set up default values for internal counters. - -($global{SECONDS},$global{MINUTE},$global{HOUR},$global{DAY},$global{MONTH},$global{YEAR})=localtime(time); -$global{YEAR} += 1900; -$global{MONTH}++; - -$global{HOURXII} = ($global{HOUR} == 12 ? 12 : ($global{HOUR})%12); -$global{TOHOUR} = ($global{HOUR} == 11 ? 12 :($global{HOUR}+1)%12); -$global{TOMINUTE} = ($global{MINUTE} == 0? 0 : 60 - $global{MINUTE}); - -package main; - -&do_require_package('fmtcount'); - -sub do_cmd_ordinaldate{ - &do_cmd_ordinalnum(@_); -} - -# define package options - -sub do_datetime_long{ - &do_cmd_longdate(@_); -} - -sub do_datetime_short{ - &do_cmd_shortdate(@_); -} - -sub do_datetime_text{ - &do_cmd_textdate(@_); -} - -sub do_datetime_ddmmyyyy{ - &do_cmd_ddmmyyyydate(@_); -} - -sub do_datetime_dmyyyy{ - &do_cmd_dmyyyydate(@_); -} - -sub do_datetime_ddmmyy{ - &do_cmd_ddmmyydate(@_); -} - -sub do_datetime_dmyy{ - &do_cmd_dmyyyydate(@_); -} - -sub do_datetime_us{ - &do_cmd_usdate(@_); -} - -sub do_datetime_mmddyyyy{ - &do_cmd_mmddyyyydate(@_); -} - -sub do_datetime_mdyyyy{ - &do_cmd_mdyyyydate(@_); -} - -sub do_datetime_mmddyy{ - &do_cmd_mmddyydate(@_); -} - -sub do_datetime_mdyy{ - &do_cmd_mdyyyydate(@_); -} - -sub do_datetime_raise{ - local($tmp)=""; - - $tmp .= 'sub do_cmd_fmtord{'; - $tmp .= 'local($_) = @_;'; - $tmp .= 'local($num) = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($num=$2));'; - $tmp .= 'join("", "",$num,"",$_);'; - $tmp .='}'; - - eval($tmp); -} - -sub do_datetime_level{ - local($tmp)=""; - - $tmp .= 'sub do_cmd_fmtord{'; - $tmp .= 'local($_) = @_;'; - $tmp .= 'local($num) = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($num=$2));'; - $tmp .= 'join("", $num,$_);'; - $tmp .='}'; - - eval($tmp); -} - -sub do_datetime_dayofweek{ - &do_cmd_showdowtrue(@_); -} - -sub do_datetime_nodayofweek{ - &do_cmd_showdowfalse(@_); -} - -sub do_datetime_24hr{ - $tmp = 'sub do_cmd_currenttime{local($_) = @_; join(\'\', "\\\\xxivtime", $_[0]); }'; - - eval($tmp); - - join('', $_[0]); -} - -sub do_datetime_12hr{ - $tmp = 'sub do_cmd_currenttime{local($_) = @_; join(\'\', "\\\\ampmtime", $_[0]); }'; - - eval($tmp); - - join('', $_[0]); -} - -sub do_datetime_oclock{ - $tmp = 'sub do_cmd_currenttime{local($_) = @_; join(\'\', "\\\\oclock", $_[0]); }'; - - eval($tmp); - - join('', $_[0]); -} - -# babel stuff (Month will already be redefined by babel, so only need to change $dateformat) - -sub do_datetime_austrian{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_dateaustrian{'; - $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_dateaustrian(@_); -} - -if (defined &austrian_today) -{ - &do_datetime_austrian(@_); -} - -sub do_datetime_bahasa{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_datebahasa{'; - $tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_datebahasa(@_); -} - -if (defined &bahasa_today) -{ - &do_datetime_bahasa(@_); -} - -sub do_datetime_basque{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_datebasque{'; - $tmp .= ' $dateformat = "THEYEAR.eko MONTHNAME[THEMONTH] THEDAY";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_datebasque(@_); -} - -if (defined &basque_today) -{ - &do_datetime_basque(@_); -} - -sub do_datetime_breton{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_datebreton{'; - $tmp .= ' $dateformat = "{ORDINALDATE{DAY}}\\ a viz MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - $tmp = 'sub do_cmd_ordinaldate{'; - $tmp .= 'local($_) = @_;'; - $tmp .= 'local($num) = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($num=$2));'; - $tmp .= 'local($before) = $num;'; - - $tmp .= 'if ($num == 1)'; - $tmp .= '{ $before .= \'a\~n\'; }'; - - $tmp .= '$before . $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_datebreton(@_); -} - -if (defined &breton_today) -{ - &do_datetime_breton(@_); -} - -sub do_datetime_bulgarian{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_datebulgarian{'; - $tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR \\cyrg.";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_datebulgarian(@_); -} - -if (defined &bulgarian_today) -{ - &do_datetime_bulgarian(@_); -} - -sub do_datetime_catalan{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_datecatalan{'; - $tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] de THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_datecatalan(@_); -} - -if (defined &catalan_today) -{ - &do_datetime_catalan(@_); -} - -sub do_datetime_croatian{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_datecroatian{'; - $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR.";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_datecroatian(@_); -} - -if (defined &croatian_today) -{ - &do_datetime_croatian(@_); -} - -sub do_datetime_czech{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_dateczech{'; - $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_dateczech(@_); -} - -if (defined &czech_today) -{ - &do_datetime_czech(@_); -} - -sub do_datetime_danish{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_datedanish{'; - $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_datedanish(@_); -} - -if (defined &danish_today) -{ - &do_datetime_danish(@_); -} - -sub do_datetime_dutch{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_datedutch{'; - $tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_datedutch(@_); -} - -if (defined &dutch_today) -{ - &do_datetime_dutch(@_); -} - -sub do_datetime_esperanto{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_dateesperanto{'; - $tmp .= ' $dateformat = "THEDAY--a de MONTHNAME[THEMONTH], THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_dateesperanto(@_); -} - -if (defined &esperanto_today) -{ - &do_datetime_esperanto(@_); -} - -sub do_datetime_estonian{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_dateestonian{'; - $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR. a.";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_dateestonian(@_); -} - -if (defined &estonian_today) -{ - &do_datetime_estonian(@_); -} - -sub do_datetime_finnish{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_datefinnish{'; - $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_datefinnish(@_); -} - -if (defined &finnish_today) -{ - &do_datetime_finnish(@_); -} - -sub do_datetime_french{ - local($tmp) = ""; - - eval($tmp); - $tmp .= 'sub do_cmd_datefrench{'; - $tmp .= ' $dateformat = "{ORDINALDATE{DAY}}\\ MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - $tmp = 'sub do_cmd_ordinaldate{'; - $tmp .= 'local($_) = @_;'; - $tmp .= 'local($num) = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($num=$2));'; - $tmp .= 'local($before) = $num;'; - - $tmp .= 'if ($num == 1)'; - $tmp .= '{ $before .= \'\ier\'; }'; - - $tmp .= '$before . $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_datefrench(@_); -} - -if (defined &french_today) -{ - &do_datetime_french(@_); -} - -sub do_datetime_galician{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_dategalician{'; - $tmp .= ' $dateformat = "THEDAY de MONTHNAME[THEMONTH] de THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_dategalician(@_); -} - -if (defined &galician_today) -{ - &do_datetime_galician(@_); -} - -sub do_datetime_german{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_dategerman{'; - $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_dategerman(@_); -} - -if (defined &german_today) -{ - &do_datetime_german(@_); -} - -sub do_datetime_greek{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_dategreek{'; - $tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_dategreek(@_); -} - -if (defined &greek_today) -{ - &do_datetime_greek(@_); -} - -sub do_datetime_icelandic{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_dateicelandic{'; - $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_dateicelandic(@_); -} - -if (defined &icelandic_today) -{ - &do_datetime_icelandic(@_); -} - -sub do_datetime_irish{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_dateirish{'; - $tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_dateirish(@_); -} - -if (defined &irish_today) -{ - &do_datetime_irish(@_); -} - -sub do_datetime_italian{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_dateitalian{'; - $tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_dateitalian(@_); -} - -if (defined &italian_today) -{ - &do_datetime_italian(@_); -} - -sub do_datetime_latin{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_datelatin{'; - $tmp .= ' $dateformat = "ROMANNUMERALU{THEDAY} MONTHNAME[THEMONTH] ROMANNUMERALU{THEYEAR}";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_datelatin(@_); -} - -if (defined &latin_today) -{ - &do_datetime_latin(@_); -} - -sub do_datetime_lsorbian{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_datelsorbian{'; - $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_datelsorbian(@_); -} - -if (defined &lsorbian_today) -{ - &do_datetime_lsorbian(@_); -} - -sub do_datetime_magyar{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_datemagyar{'; - $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR.";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_datemagyar(@_); -} - -if (defined &magyar_today) -{ - &do_datetime_magyar(@_); -} - -sub do_datetime_naustrian{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_datenaustrian{'; - $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_datenaustrian(@_); -} - -if (defined &naustrian_today) -{ - &do_datetime_naustrian(@_); -} - -sub do_datetime_ngerman{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_datengerman{'; - $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_datengerman(@_); -} - -if (defined &ngerman_today) -{ - &do_datetime_ngerman(@_); -} - -sub do_datetime_norsk{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_datenorsk{'; - $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_datenorsk(@_); -} - -if (defined &norsk_today) -{ - &do_datetime_norsk(@_); -} - -sub do_datetime_polish{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_datenorsk{'; - $tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_datenorsk(@_); -} - -if (defined &polish_today) -{ - &do_datetime_polish(@_); -} - -sub do_datetime_portuges{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_dateportuges{'; - $tmp .= ' $dateformat = "THEDAY de MONTHNAME[THEMONTH] de THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_dateportuges(@_); -} - -if (defined &portuges_today) -{ - &do_datetime_portuges(@_); -} - -sub do_datetime_romanian{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_dateromanian{'; - $tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_dateromanian(@_); -} - -if (defined &romanian_today) -{ - &do_datetime_romanian(@_); -} - -sub do_datetime_russian{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_daterussian{'; - $tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR \\\\cyrg.";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_daterussian(@_); -} - -if (defined &russian_today) -{ - &do_datetime_russian(@_); -} - -sub do_datetime_samin{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_datesamin{'; - $tmp .= ' $dateformat = "MONTHNAME[THEMONTH] THEDAY.~b. THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_datesamin(@_); -} - -if (defined &samin_today) -{ - &do_datetime_samin(@_); -} - -sub do_datetime_scottish{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_datescottish{'; - $tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_datescottish(@_); -} - -if (defined &scottish_today) -{ - &do_datetime_scottish(@_); -} - -sub do_datetime_serbian{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_dateserbian{'; - $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_dateserbian(@_); -} - -if (defined &serbian_today) -{ - &do_datetime_serbian(@_); -} - -sub do_datetime_slovak{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_dateslovak{'; - $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_dateslovak(@_); -} - -if (defined &slovak_today) -{ - &do_datetime_slovak(@_); -} - -sub do_datetime_slovene{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_dateslovene{'; - $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_dateslovene(@_); -} - -if (defined &slovene_today) -{ - &do_datetime_slovene(@_); -} - -sub do_datetime_spanish{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_datespanish{'; - $tmp .= ' $dateformat = "THEDAY~de MONTHNAME[THEMONTH] de~THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_datespanish(@_); -} - -if (defined &spanish_today) -{ - &do_datetime_spanish(@_); -} - -sub do_datetime_swedish{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_dateswedish{'; - $tmp .= ' $dateformat = "THEDAY~MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - $tmp = ""; - $tmp .= 'sub do_cmd_datesymd{'; - $tmp .= ' $dateformat = "THEYEAR-TWODIGIT{THEMONTH}-TWODIGIT{THEDAY}";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - $tmp = ""; - $tmp .= 'sub do_cmd_datesdmy{'; - $tmp .= ' $dateformat = "THEDAY/THEMONTH THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_dateswedish(@_); -} - -if (defined &swedish_today) -{ - &do_datetime_swedish(@_); -} - -sub do_datetime_turkish{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_dateturkish{'; - $tmp .= ' $dateformat = "THEDAY~MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_dateturkish(@_); -} - -if (defined &turkish_today) -{ - &do_datetime_turkish(@_); -} - -sub do_datetime_ukraineb{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_dateukraineb{'; - $tmp .= ' $dateformat = "THEDAY~MONTHNAME[THEMONTH] THEYEAR~\\\\cyrr.";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_dateukraineb(@_); -} - -if (defined &ukraineb_today) -{ - &do_datetime_ukraineb(@_); -} - -sub do_datetime_usorbian{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_dateusorbian{'; - $tmp .= ' $dateformat = "THEDAY.~MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_dateusorbian(@_); -} - -if (defined &usorbian_today) -{ - &do_datetime_usorbian(@_); -} - -sub do_datetime_welsh{ - local($tmp) = ""; - - $tmp .= 'sub do_cmd_datewelsh{'; - $tmp .= ' $dateformat = "{ORDINALDATE{DAY}}\\ a viz MONTHNAME[THEMONTH] THEYEAR";'; - $tmp .= ' $_[0];'; - $tmp .= '}'; - - eval($tmp); - - $tmp = 'sub do_cmd_ordinaldate{'; - $tmp .= 'local($_) = @_;'; - $tmp .= 'local($num) = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($num=$2));'; - $tmp .= 'local($before) = $num;'; - - $tmp .= 'if ($num == 1)'; - $tmp .= '{ $before .= \'a\~n\'; }'; - - $tmp .= '$before . $_[0];'; - $tmp .= '}'; - - eval($tmp); - - &do_cmd_datewelsh(@_); -} - -if (defined &welsh_today) -{ - &do_datetime_welsh(@_); -} - -# As far as I know, LaTeX2HTML doesn't implement TeX conditionals. -# $showdow corresponds to LaTeX boolean variable showdow -$showdow = 1; - -sub get_monthname{ - local($month) = @_; - - if ($month eq 'THEMONTH' or $month eq '\THEMONTH') - { - # this is a cludge to help newdateformat work - - 'MONTHNAME[THEMONTH]'; - } - else - { - if ($month eq '') - { - local($today) = &get_date(); - $today =~ m|(\d+)/0?(\d+)/|; - $month = $1; - } - - $Month[$month]; - } -} - -sub do_cmd_monthname{ - local($_) = @_; - local($month,$pat) = &get_next_optional_argument; - - local($monthname) = &get_monthname($month); - join('',$monthname,$_); -} - -sub get_shortmonthname{ - local($month) = @_; - - if ($month eq 'THEMONTH' or $month eq '\THEMONTH') - { - 'SHORTMONTHNAME[THEMONTH]'; - } - else - { - substr(&get_monthname($month), 0, 3); - } -} - -sub do_cmd_shortmonthname{ - local($_) = @_; - local($month,$pat) = &get_next_optional_argument; - - local($monthname) = &get_shortmonthname($month); - - join('',$monthname,$_); -} - -sub is_leap_year{ - local($year) = @_; - local($isleapyear) = 0; - - if (($year%400) == 0) - { - # year mod 400 = 0 => leap year - - $isleapyear = 1; - } - elsif (($year%100) == 0) - { - # year mod 100 = 0 and year mod 400 != 0 => not a leap year - - $isleapyear = 0; - } - elsif (($year%4) == 0) - { - # year mod 4 = 0 and year mod 100 != 0 => leap year - - $isleapyear = 1; - } - - $isleapyear; -} - -sub get_day_of_year{ - local($day,$month,$year) = @_; - local($dayofyear) = 0; - - SWITCH: { - if ($month == 2) {$dayofyear += 31; last SWITCH; } - if ($month == 3) {$dayofyear += 59; last SWITCH; } - if ($month == 4) {$dayofyear += 90; last SWITCH; } - if ($month == 5) {$dayofyear += 120; last SWITCH; } - if ($month == 6) {$dayofyear += 151; last SWITCH; } - if ($month == 7) {$dayofyear += 181; last SWITCH; } - if ($month == 8) {$dayofyear += 212; last SWITCH; } - if ($month == 9) {$dayofyear += 243; last SWITCH; } - if ($month == 10) {$dayofyear += 273; last SWITCH; } - if ($month == 11) {$dayofyear += 304; last SWITCH; } - if ($month == 12) {$dayofyear += 334; last SWITCH; } - } - - if ($month > 2 && &is_leap_year($year)) - { - $dayofyear += 1; - } - - $dayofyear += $day; - local($_)=$dayofyear; -} - -sub get_day_of_week{ - local($day,$month,$year) = @_; - local($dayofyear) = &get_day_of_year($day,$month,$year); - local($_) = (((($year-1901)%28)*1.25 + 2)%7 + $dayofyear - 1)%7 + 1; -} - -sub get_day_of_weekname_english{ - local($dow) = @_; - - local(@DayOfWeek) = ('Sunday', - 'Monday', - 'Tuesday', - 'Wednesday', - 'Thursday', - 'Friday', - 'Saturday'); - - if ($dow <= 0 || $dow > 7) - { - &write_warnings("Invalid day of week number: $dow"); - } - else - { - $DayOfWeek[$dow-1]; - } -} - -sub get_day_of_weekname_french{ - local($dow) = @_; - - local(@DayOfWeek) = ('dimanche', - 'lundi', - 'mardi', - 'mercredi', - 'jeudi', - 'vendredi', - 'samedi'); - - if ($dow <= 0 || $dow > 7) - { - &write_warnings("Invalid day of week number: $dow"); - } - else - { - $DayOfWeek[$dow-1]; - } -} - -sub get_day_of_weekname_spanish{ - local($dow) = @_; - - local(@DayOfWeek) = ('domingo', - 'lunes', - 'martes', - 'mi\\\'ercoles', - 'jueves', - 'viernes', - 's\\\'abado'); - - if ($dow <= 0 || $dow > 7) - { - &write_warnings("Invalid day of week number: $dow"); - } - else - { - $DayOfWeek[$dow-1]; - } -} - -sub get_day_of_weekname_portuges{ - local($dow) = @_; - - local(@DayOfWeek) = ('domingo', - 'segunda-feira', - 'ter\c{c}a-feira', - 'quarta-feira', - 'quinta-feira', - 'sexta-feira', - 'sabado'); - - if ($dow <= 0 || $dow > 7) - { - &write_warnings("Invalid day of week number: $dow"); - } - else - { - $DayOfWeek[$dow-1]; - } -} - -sub get_day_of_weekname_german{ - local($dow) = @_; - - local(@DayOfWeek) = ('Sonntag', - 'Montag', - 'Dienstag', - 'Mittwoch', - 'Donnerstag', - 'Freitag', - 'Samstag'); - - if ($dow <= 0 || $dow > 7) - { - &write_warnings("Invalid day of week number: $dow"); - } - else - { - $DayOfWeek[$dow-1]; - } -} - -sub get_day_of_weekname_ngerman{ - local($dow) = @_; - - local(@DayOfWeek) = ('Sonntag', - 'Montag', - 'Dienstag', - 'Mittwoch', - 'Donnerstag', - 'Freitag', - 'Samstag'); - - if ($dow <= 0 || $dow > 7) - { - &write_warnings("Invalid day of week number: $dow"); - } - else - { - $DayOfWeek[$dow-1]; - } -} - -sub get_day_of_weekname{ - local($dow)=@_; - local($dowsub); - - $dowsub = "get_day_of_weekname_$default_language"; - - if (defined ($dowsub)) - { - &$dowsub($dow); - } - else - { - &get_day_of_weekname_english($dow); - } -} - -sub get_short_day_of_weekname_english{ - local($dow) = @_; - - local(@DayOfWeek) = ('Sun', - 'Mon', - 'Tue', - 'Wed', - 'Thu', - 'Fri', - 'Sat'); - - if ($dow <= 0 || $dow > 7) - { - &write_warnings("Invalid day of week number: $dow"); - } - else - { - $DayOfWeek[$dow-1]; - } -} - -sub get_short_day_of_weekname_german{ - local($dow) = @_; - - local(@DayOfWeek) = ('So', - 'Mo', - 'Di', - 'Mi', - 'Do', - 'Fr', - 'Sa'); - - if ($dow <= 0 || $dow > 7) - { - &write_warnings("Invalid day of week number: $dow"); - } - else - { - $DayOfWeek[$dow-1]; - } -} - -sub get_short_day_of_weekname_ngerman{ - local($dow) = @_; - - local(@DayOfWeek) = ('So', - 'Mo', - 'Di', - 'Mi', - 'Do', - 'Fr', - 'Sa'); - - if ($dow <= 0 || $dow > 7) - { - &write_warnings("Invalid day of week number: $dow"); - } - else - { - $DayOfWeek[$dow-1]; - } -} - -sub get_short_day_of_weekname{ - local($dow)=@_; - local($dowsub); - - $dowsub = "get_short_day_of_weekname_$default_language"; - - if (defined ($dowsub)) - { - &$dowsub($dow); - } - else - { - substr(&get_day_of_weekname($dow),0,3); - } -} - -sub do_cmd_dayofweeknameid{ - local($_) = @_; - local($dow); - - $dow = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($dow=$2)); - - join('',&get_day_of_weekname($dow), $_); -} - -sub do_cmd_dayofweekname{ - local($_) = @_; - local($day,$month,$year); - # read 1st argument - $day = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($day=$2)); - # read 2nd argument - $month = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($month=$2)); - # read 3rd argument - $year = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($year=$2)); - - if ($day eq 'THEDAY' or $day eq '\THEDAY') - { - # this is a cludge to help newdateformat work - - join('', '{DOW}', $_); - } - else - { - local($dow) = &get_day_of_week($day,$month,$year); - - join('',&get_day_of_weekname($dow), $_); - } -} - -sub do_cmd_shortdayofweekname{ - local($_) = @_; - local($day,$month,$year); - # read 1st argument - $day = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($day=$2)); - # read 2nd argument - $month = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($month=$2)); - # read 3rd argument - $year = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($year=$2)); - - local($dow) = &get_day_of_week($day,$month,$year); - - join('',&get_short_day_of_weekname($dow), $_); -} - -sub do_cmd_thisdayofweekname{ - local($dow) = &get_day_of_week($global{DAY}, $global{MONTH}, $global{YEAR}); - - join('',$DayOfWeek[$dow], $_); -} - -sub do_cmd_thisshortdayofweekname{ - local($dow) = &get_day_of_week($global{DAY}, $global{MONTH}, $global{YEAR}); - - join('',&get_short_day_of_weekname($dow), $_); -} - -$dateformat = "\\ifshowdow{DOW}\\fi {ORDINALDATE{DAY}}\\ MONTHNAME[THEMONTH], THEYEAR"; - -sub format_date{ - local($day,$month,$year) = @_; - - local($str) = $dateformat; - - $str =~ s/THEDAY/$day/g; - $str =~ s/THEMONTH/$month/g; - $str =~ s/THEYEAR/$year/g; - - $str =~ s/TWODIGIT{([\d]+)}/&get_twodigit($1)/eg; - $str =~ s/ROMANNUMERAL{([\d]+)}/&froman($1)/eg; - $str =~ s/ROMANNUMERALU{([\d]+)}/uc(&froman($1))/eg; - $str =~ s/TRUNCATE{([\d]+)}/&get_twodigit($1%100)/eg; - $str =~ s/SHORTMONTHNAME\[([\d]+)\]/&get_shortmonthname($1)/eg; - $str =~ s/MONTHNAME\[([\d]+)\]/&get_monthname($1)/eg; - - local($X) = ++$global{'max_id'}; - local($Y) = ++$global{'max_id'}; - local($Z) = ++$global{'max_id'}; - $str =~ s/{DOW}/\\dayofweekname${OP}$X${CP}$day${OP}$X${CP}${OP}$Y${CP}$month${OP}$Y${CP}${OP}$Z${CP}$year${OP}$Z${CP}/g; - $str =~ s/{SDOW}/\\shortdayofweekname${OP}$X${CP}$day${OP}$X${CP}${OP}$Y${CP}$month${OP}$Y${CP}${OP}$Z${CP}$year${OP}$Z${CP}/g; - - local($br_id) = ++$global{'max_id'}; - $suffix = &get_ordinal_suffix($day); - $str =~ s/{ORDINAL{DAY}}/$day\\fmtord${OP}$br_id${CP}$suffix${OP}$br_id${CP}/g; - - $br_id = ++$global{'max_id'}; - $suffix = &get_ordinal_suffix($month); - $str =~ s/{ORDINAL{MONTH}}/$month\\fmtord${OP}$br_id${CP}$suffix${OP}$br_id${CP}/g; - - $br_id = ++$global{'max_id'}; - $suffix = &get_ordinal_suffix($year); - $str =~ s/{ORDINAL{YEAR}}/$year\\fmtord${OP}$br_id${CP}$suffix${OP}$br_id${CP}/g; - - local($br_id) = ++$global{'max_id'}; - $str =~ s/{ORDINALDATE{DAY}}/\\ordinaldate${OP}$br_id${CP}$day${OP}$br_id${CP}/g; - - $str =~ s/{NNUMBERSTRING{DAY}}/&get_Numberstring($day)/eg; - $str =~ s/{NNUMBERSTRING{MONTH}}/&get_Numberstring($month)/eg; - $str =~ s/{NNUMBERSTRING{YEAR}}/&get_Numberstring($year)/eg; - - $str =~ s/{OORDINALSTRING{DAY}}/&get_Ordinalstring($day)/eg; - $str =~ s/{OORDINALSTRING{MONTH}}/&get_Ordinalstring($month)/eg; - $str =~ s/{OORDINALSTRING{YEAR}}/&get_Ordinalstring($year)/eg; - - $str =~ s/{CAPNUMBERSTRING{DAY}}/uc(&get_numberstring($day))/eg; - $str =~ s/{CAPNUMBERSTRING{MONTH}}/uc(&get_numberstring($month))/eg; - $str =~ s/{CAPNUMBERSTRING{YEAR}}/uc(&get_numberstring($year))/eg; - - $str =~ s/{CAPORDINALSTRING{DAY}}/uc(&get_ordinalstring($day))/eg; - $str =~ s/{CAPORDINALSTRING{MONTH}}/uc(&get_ordinalstring($month))/eg; - $str =~ s/{CAPORDINALSTRING{YEAR}}/uc(&get_ordinalstring($year))/eg; - - $str =~ s/{NUMBERSTRING{DAY}}/&get_numberstring($day)/eg; - $str =~ s/{NUMBERSTRING{MONTH}}/&get_numberstring($month)/eg; - $str =~ s/{NUMBERSTRING{YEAR}}/&get_numberstring($year)/eg; - - $str =~ s/{ORDINALSTRING{DAY}}/&get_ordinalstring($day)/eg; - $str =~ s/{ORDINALSTRING{MONTH}}/&get_ordinalstring($month)/eg; - $str =~ s/{ORDINALSTRING{YEAR}}/&get_ordinalstring($year)/eg; - - $str; -} - -sub do_cmd_formatdate{ - local($day,$month,$year); - # read 1st argument - $day = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($day=$2)); - # read 2nd argument - $month = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($month=$2)); - # read 3rd argument - $year = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($year=$2)); - - join('', &format_date($day,$month,$year), $_[0]); -} - -sub do_cmd_today{ - join('', &format_date($global{DAY},$global{MONTH},$global{YEAR}), $_[0]); -} - -sub do_cmd_day{ - join('', $global{DAY}, $_[0]); -} - -sub do_cmd_month{ - join('', $global{MONTH}, $_[0]); -} - -sub do_cmd_year{ - join('', $global{YEAR}, $_[0]); -} - -sub do_cmd_showdowtrue{ - local($_) = @_; - $showdow = 1; - $_[0]; -} - -sub do_cmd_showdowfalse{ - local($_) = @_; - $showdow = 0; - $_[0]; -} - -# This is a bit primative, it doesn't allow for -# nested conditionals - -sub do_cmd_ifshowdow{ - local($_) = @_; - local($ifbit,$elsebit); - - $_[0] =~s/(.*)\\fi//; - - $ifbit = $1; - - $ifbit =~s/(.*)\\else(.*)/\1/g; - - $elsebit = $2; - - if ($showdow) - { - join('', $ifbit, $_[0]); - } - else - { - join('', $elsebit, $_[0]); - } -} - -sub do_cmd_dateseparator{ - join('', '/', $_[0]); -} - -sub do_cmd_longdate{ - $dateformat = "\\ifshowdow{DOW}\\fi {ORDINALDATE{DAY}}\\ MONTHNAME[THEMONTH], THEYEAR"; - - $_[0]; -} - -sub do_cmd_shortdate{ - $dateformat = "\\ifshowdow{SDOW}\\fi {ORDINALDATE{DAY}}\\ SHORTMONTHNAME[THEMONTH], THEYEAR"; - - $_[0]; -} - -sub do_cmd_ddmmyyyydate{ - $dateformat = "TWODIGIT{THEDAY}\\dateseparator TWODIGIT{THEMONTH}\\dateseparator THEYEAR"; - - $_[0]; -} - -sub do_cmd_dmyyyydate{ - $dateformat = "THEDAY\\dateseparator THEMONTH\\dateseparator THEYEAR"; - - $_[0]; -} - -sub do_cmd_dmyydate{ - $dateformat = "THEDAY\\dateseparator THEMONTH\\dateseparator TRUNCATE{THEYEAR}"; - - $_[0]; -} - -sub do_cmd_ddmmyydate{ - $dateformat = "TWODIGIT{THEDAY}\\dateseparator TWODIGIT{THEMONTH}\\dateseparator TRUNCATE{THEYEAR}"; - - $_[0]; -} - -sub do_cmd_textdate{ - $dateformat = "\\ifshowdow{DOW} the\\fi {OORDINALSTRING{DAY}} of MONTHNAME[THEMONTH], {NNUMBERSTRING{YEAR}}"; - - $_[0]; -} - -sub do_cmd_usdate{ - $dateformat = "MONTHNAME[THEMONTH] THEDAY, THEYEAR"; - - $_[0]; -} - -sub do_cmd_mmddyyyydate{ - $dateformat = "TWODIGIT{THEMONTH}\\dateseparator TWODIGIT{THEDAY}\\dateseparator THEYEAR"; - - $_[0]; -} - -sub do_cmd_mdyyyydate{ - $dateformat = "THEMONTH\\dateseparator THEDAY\\dateseparator THEYEAR"; - - $_[0]; -} - -sub do_cmd_mmddyydate{ - $dateformat = "TWODIGIT{THEMONTH}\\dateseparator TWODIGIT{THEDAY}\\dateseparator TRUNCATE{THEYEAR}"; - - $_[0]; -} - -sub do_cmd_mdyydate{ - $dateformat = "THEMONTH\\dateseparator THEDAY\\dateseparator TRUNCATE{THEYEAR}"; - - $_[0]; -} - -sub do_cmd_THEYEAR{ - join('', 'THEYEAR', $_[0]); -} - -sub do_cmd_THEMONTH{ - join('', 'THEMONTH', $_[0]); -} - -sub do_cmd_THEDAY{ - join('', 'THEDAY', $_[0]); -} - -sub do_cmd_newdateformat{ - local($_) = @_; - local($cmd,$cmdbody); - local($ntmp); - - $cmd = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($cmd=$2)); - $cmdbody = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($cmdbody=$2)); - - $ntmp = 'sub do_cmd_' . $cmd . '{'; - $ntmp .= '$dateformat = "' . $cmdbody . '";'; - - $ntmp .= '$_[0];'; - $ntmp .= '}'; - - eval($ntmp); - - join('', $_[0]); -} - -sub do_cmd_pdfdate{ - local($_) = @_; - - local($timestring) = sprintf "%d%02d%02d%02d%02d%02d", - $global{YEAR}, $global{MONTH}, $global{DAY}, $global{HOUR}, $global{MINUTE}, $global{SECONDS}; - - join('', $timestring, $_[0]); -} - - %userdates = (); - -sub do_cmd_newdate{ - local($_)=@_; - local($datename,$mon,$day,$year); - - $datename = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($datename=$2)); - - $day = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($day=$2)); - - $mon = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($mon =$2)); - - $year = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($year =$2)); - - - $userdates{$datename}{day} = $day; - $userdates{$datename}{month} = $mon; - $userdates{$datename}{year} = $year; - - join('', $_[0]); -} - -sub do_cmd_displaydate{ - local($_)=@_; - local($datename); - local($cmd,$br_id); - - $datename = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($datename=$2)); - - $br_id = ++$global{'max_id'}; - $cmd = "$OP$br_id$CP" . $userdates{$datename}{day} ."$OP$br_id$CP"; - $br_id = ++$global{'max_id'}; - $cmd .= "$OP$br_id$CP" . $userdates{$datename}{month} ."$OP$br_id$CP"; - $br_id = ++$global{'max_id'}; - $cmd .= "$OP$br_id$CP" . $userdates{$datename}{year} ."$OP$br_id$CP"; - - join('', '\formatdate', $cmd, $_[0]); -} - -sub do_cmd_getdateyear{ - local($_)=@_; - local($datename); - - $datename = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($datename=$2)); - - join('', $userdates{$datename}{year}, $_[0]); -} - -sub do_cmd_getdatemonth{ - local($_)=@_; - local($datename); - - $datename = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($datename=$2)); - - join('', $userdates{$datename}{month}, $_[0]); -} - -sub do_cmd_getdateday{ - local($_)=@_; - local($datename); - - $datename = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($datename=$2)); - - join('', $userdates{$datename}{day}, $_[0]); -} - -# time commands - -sub do_cmd_timeseparator{ - join('', ':', $_[0]); -} - -sub do_cmd_xxivtime{ - local($_) = @_; - - local($timestring) = sprintf "%02d\\timeseparator %02d", $global{HOUR}, $global{MINUTE}; - - join('', $timestring, $_[0]); -} - -sub do_cmd_noon{ - local($_) = @_; - - join('', "Noon", $_[0]); -} - -sub do_cmd_midnight{ - local($_) = @_; - - join('', "Midnight", $_[0]); -} - -sub do_cmd_amname{ - local($_) = @_; - - join('', "am", $_[0]); -} - -sub do_cmd_pmname{ - local($_) = @_; - - join('', "pm", $_[0]); -} - -sub do_cmd_amstring{ - local($_) = @_; - - join('', "in the morning", $_[0]); -} - -sub do_cmd_pmstring{ - local($_) = @_; - - join('', "in the afternoon", $_[0]); -} - -sub do_cmd_halfpast{ - local($_) = @_; - - join('', "Half past", $_[0]); -} - -sub do_cmd_quarterpast{ - local($_) = @_; - - join('', "Quarter past", $_[0]); -} - -sub do_cmd_quarterto{ - local($_) = @_; - - join('', "Quarter to", $_[0]); -} - -sub do_cmd_oclockstring{ - local($_) = @_; - - join('', "O'Clock", $_[0]); -} - -sub do_cmd_amorpmname{ - if ($global{HOUR}>12) - { - &do_cmd_pmname; - } - else - { - &do_cmd_amname; - } -} - -sub do_cmd_amorpmstring{ - if ($global{HOUR}>12) - { - &do_cmd_pmstring; - } - else - { - &do_cmd_amstring; - } -} - -sub do_cmd_ampmtime{ - local($_) = @_; - local($timestring); - - $timestring = sprintf "%d\\timeseparator %02d\\amorpmname", $global{HOUR}, $global{MINUTE}; - - join('', $timestring, $_[0]); -} - -sub do_cmd_oclock{ - local($_) = @_; - local($timestring); - - if ($global{HOUR} == 0 && $global{MINUTE} == 0) - { - $timestring = "\\midnight"; - } - elsif ($global{HOUR} == 12 && $global{MINUTE} == 0) - { - $timestring = "\\noon"; - } - else - { - if ($global{MINUTE} == 0) - { - $timestring = &get_Numberstring($global{HOURXII}) . " \\oclockstring"; - } - elsif ($global{MINUTE} == 15) - { - $timestring = "\\quarterpast\\ " . &get_Numberstring($global{HOURXII}); - } - elsif ($global{MINUTE} == 30) - { - $timestring = "\\halfpast\\ " . &get_Numberstring($global{HOURXII}); - } - elsif ($global{MINUTE} == 45) - { - $timestring = "\\quarterto\\ " . &get_Numberstring($global{TOHOUR}); - } - elsif ($global{MINUTE} < 30) - { - $timestring = get_Numberstring($global{MINUTE}); - - $timestring .= ($global{MINUTE} == 1 ? " minute" : " minutes") . " past "; - - $timestring .= get_Numberstring($global{HOURXII}); - } - else - { - $timestring = get_Numberstring($global{TOMINUTE}); - - $timestring .= ($global{MINUTE} == 1 ? " minute" : " minutes") . " to "; - - $timestring .= get_Numberstring($global{TOHOUR}); - } - - $timestring .= ($global{HOUR} < 12 ? " \\amstring" : " \\pmstring"); - } - - join('', $timestring, $_[0]); -} - -sub do_cmd_currenttime{ - local($_) = @_; - - join('', "\\xxivtime", $_[0]); -} - -sub do_cmd_settimeformat{ - local($_) = @_; - local($cmd); - - $cmd = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($cmd=$2)); - - #$tmp = 'sub do_cmd_currenttime{local($_) = @_; join(\'\', "\\\\' . $cmd . '", $_[0]); }'; - - $tmp = 'sub do_cmd_currenttime{&do_cmd_' . $cmd . '(@_);}'; - - eval($tmp); - - join('', $_[0]); -} - -sub do_cmd_newtimeformat{ - local($_) = @_; - local($cmd,$cmdbody); - - $cmd = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($cmd=$2)); - $cmdbody = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($cmdbody=$2)); - - $tmp = 'sub do_cmd_' . $cmd . '{' . "\n"; - - $tmp .= 'local($_) = @_;'. "\n"; - - $tmp .= 'join(\'\',"' . $cmdbody. '", $_[0]); }'; - - eval($tmp); - - join('', $_[0]); -} - -sub do_cmd_THEHOUR{ - local($_) = @_; - - join('', $global{HOUR}, $_[0]); -} - -sub do_cmd_THEMINUTE{ - local($_) = @_; - - join('', $global{MINUTE}, $_[0]); -} - -sub do_cmd_THETOHOUR{ - local($_) = @_; - - join('', $global{TOHOUR}, $_[0]); -} - -sub do_cmd_THETOMINUTE{ - local($_) = @_; - - join('', $global{TOMINUTE}, $_[0]); -} - -sub do_cmd_THEHOURXII{ - local($_) = @_; - - join('', $global{HOURXII}, $_[0]); -} - -1; -% \end{macrocode} -%\iffalse -% \begin{macrocode} -% -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*dt-sampl.tex> -% \end{macrocode} -%\fi -%\subsection{Sample Document} -% \begin{macrocode} -\documentclass[a4paper]{article} - -\usepackage{ifpdf} -\usepackage{datetime} - -\ifpdf -\pdfinfo{ - /CreationDate (D:20040501215500) - /ModDate (D:\pdfdate) -} -\fi - -\padzeroes[8] - -\newdateformat{dashdate}{\twodigit{\THEDAY}-\twodigit{\THEMONTH}-\THEYEAR} -\newdateformat{usvardate}{\monthname[\THEMONTH]~\ordinaldate{\THEDAY}, \THEYEAR} -\newdateformat{mydate}{\ifshowdow \dayofweekname{\THEDAY}{\THEMONTH}{\THEYEAR} \fi -\THEDAY\ \monthname[\THEMONTH], \THEYEAR} -\newdateformat{yyyymmdd}{\THEYEAR\twodigit{\THEMONTH}\twodigit{\THEDAY}} -\newdateformat{ukvardate}{\THEDAY\ \monthname[\THEMONTH]\ \THEYEAR} - -\newtimeformat{dottime}{\twodigit{\THEHOUR}.\twodigit{\THEMINUTE}} -\newtimeformat{dashtime12}{\THEHOURXII-\twodigit{\THEMINUTE}} -\newtimeformat{hhmm}{\twodigit{\THEHOUR}\twodigit{\THEMINUTE}} - -\begin{document} - -\section{Date Formats} -Default: \today. - -\begin{tabular}{ll} -\bfseries Declaration & \bfseries\verb|\today|\\ -\verb|\longdate| & \longdate\today\\ -\verb|\shortdate| & \shortdate\today\\ -\verb|\ddmmyyyydate| & \ddmmyyyydate\today\\ -\verb|\dmyyyydate| & \dmyyyydate\today\\ -\verb|\ddmmyydate| & \ddmmyydate\today\\ -\verb|\dmyydate| & \dmyydate\today\\ -\verb|\textdate| & \textdate\today\\ -\verb|\usdate| & \usdate\today\\ -\verb|\mmddyyyydate| & \mmddyyyydate\today\\ -\verb|\mdyyyydate| & \mdyyyydate\today\\ -\verb|\mmddyydate| & \mmddyydate\today\\ -\verb|\mdyydate| & \mdyydate\today -\end{tabular} - -\section{Time Formats} -Default: \currenttime. - -\begin{tabular}{@{\ttfamily}ll} -\bfseries\rmfamily Format & \bfseries \verb|\currenttime|\\ -xxivtime & \settimeformat{xxivtime}\currenttime\\ -ampmtime & \settimeformat{ampmtime}\currenttime\\ -oclock & \settimeformat{oclock}\currenttime -\end{tabular} - -\section{Specific Date:} - -\begin{tabular}{ll} -\verb|\longdate| & \longdate\formatdate{1}{3}{2000}\\ -\verb|\shortdate| & \shortdate\formatdate{8}{3}{2000}\\ -\verb|\ddmmyyyydate| & \ddmmyyyydate\formatdate{8}{3}{2000}\\ -\verb|\dmyyyydate| & \dmyyyydate\formatdate{8}{3}{2000}\\ -\verb|\ddmmyydate| & \ddmmyydate\formatdate{8}{3}{2000}\\ -\verb|\dmyydate| & \dmyydate\formatdate{8}{3}{2000}\\ -\verb|\textdate| & \textdate\formatdate{8}{3}{2000}\\ -\verb|\usdate| & \usdate\formatdate{8}{3}{2000}\\ -\verb|\mmddyyyydate| & \mmddyyyydate\formatdate{8}{3}{2000}\\ -\verb|\mdyyyydate| & \mdyyyydate\formatdate{8}{3}{2000}\\ -\verb|\mmddyydate| & \mmddyydate\formatdate{8}{3}{2000}\\ -\verb|\mdyydate| & \mdyydate\formatdate{8}{3}{2000} -\end{tabular} - -\section{Defining New Dates} - -\begin{tabular}{ll} -\verb|\dashdate| & \dashdate\today\\ -\verb|\usvardate| & \usvardate\today\\ -\verb|\ukvardate| & \ukvardate\today\\ -\verb|\mydate| & \mydate\today\\ -\verb|\yyyymmdd| & \yyyymmdd\today\\ -\verb|\dashdate| & \dashdate\formatdate{8}{3}{2000}\\ -\verb|\usvardate| & \usvardate\formatdate{8}{3}{2000}\\ -\verb|\mydate| & \mydate\formatdate{8}{3}{2000}\\ -\verb|\yyyymmdd| & \yyyymmdd\formatdate{8}{3}{2000} -\end{tabular} - -\section{Defining New Times} - -\begin{tabular}{@{\ttfamily}ll} -\bfseries\rmfamily Format & \bfseries \verb|\currenttime|\\ -dottime & \settimeformat{dottime}\currenttime\\ -dashtime12 & \settimeformat{dashtime12}\currenttime\\ -hhmm & \settimeformat{hhmm}\currenttime -\end{tabular} - -\end{document} -% \end{macrocode} -%\iffalse -% \begin{macrocode} -% -% \end{macrocode} -%\fi %\Finale \endinput diff --git a/Master/texmf-dist/source/latex/datetime/datetime.ins b/Master/texmf-dist/source/latex/datetime/datetime.ins index 44e541c8675..ab67202ba1a 100644 --- a/Master/texmf-dist/source/latex/datetime/datetime.ins +++ b/Master/texmf-dist/source/latex/datetime/datetime.ins @@ -1,106 +1,121 @@ -% datetime.ins generated using makedtx version 0.91b 2007/4/21 19:13 +% datetime.ins generated using makedtx version 0.94b 2007/8/20 15:37 \input docstrip \preamble -Copyright (C) 2007 Nicola Talbot, all rights reserved. -If you modify this file, you must change its name first. -You are NOT ALLOWED to distribute this file alone. You are NOT -ALLOWED to take money for the distribution or use of either this -file or a changed version, except for a nominal charge for copying -etc. + + datetime.dtx + Copyright 2007 Nicola Talbot + + This work may be distributed and/or modified under the + conditions of the LaTeX Project Public License, either version 1.3 + of this license of (at your option) any later version. + The latest version of this license is in + http://www.latex-project.org/lppl.txt + and version 1.3 or later is part of all distributions of LaTeX + version 2005/12/01 or later. + + This work has the LPPL maintenance status `maintained'. + + 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. + \endpreamble \askforoverwritefalse -\generate{\file{dt-breton.def}{\usepreamble\defaultpreamble +\generate{\file{datetime.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{datetime.sty,package}} +\file{dt-austrian.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-austrian.def,package}} +\file{dt-bahasa.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-bahasa.def,package}} +\file{dt-basque.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-basque.def,package}} +\file{dt-breton.def}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{datetime.dtx}{dt-breton.def,package}} -\file{dt-danish.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-danish.def,package}} -\file{dt-sampl.tex}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-sampl.tex,package}} -\file{dt-welsh.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-welsh.def,package}} -\file{dt-scottish.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-scottish.def,package}} -\file{dt-latin.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-latin.def,package}} -\file{dt-portuges.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-portuges.def,package}} -\file{dt-estonian.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-estonian.def,package}} -\file{dt-usorbian.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-usorbian.def,package}} -\file{dt-spanish.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-spanish.def,package}} -\file{dt-slovene.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-slovene.def,package}} -\file{dt-dutch.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-dutch.def,package}} +\file{dt-british.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-british.def,package}} \file{dt-bulgarian.def}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{datetime.dtx}{dt-bulgarian.def,package}} -\file{dt-ngerman.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-ngerman.def,package}} -\file{dt-italian.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-italian.def,package}} -\file{dt-french.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-french.def,package}} -\file{dt-hebrew.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-hebrew.def,package}} +\file{dt-catalan.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-catalan.def,package}} +\file{dt-croatian.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-croatian.def,package}} \file{dt-czech.def}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{datetime.dtx}{dt-czech.def,package}} -\file{dt-romanian.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-romanian.def,package}} +\file{dt-danish.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-danish.def,package}} +\file{dt-dutch.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-dutch.def,package}} \file{dt-esperanto.def}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{datetime.dtx}{dt-esperanto.def,package}} -\file{dt-polish.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-polish.def,package}} +\file{dt-estonian.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-estonian.def,package}} \file{dt-finnish.def}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{datetime.dtx}{dt-finnish.def,package}} +\file{dt-french.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-french.def,package}} \file{dt-galician.def}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{datetime.dtx}{dt-galician.def,package}} -\file{dt-magyar.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-magyar.def,package}} -\file{dt-slovak.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-slovak.def,package}} -\file{dt-lsorbian.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-lsorbian.def,package}} +\file{dt-german.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-german.def,package}} \file{dt-greek.def}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{datetime.dtx}{dt-greek.def,package}} -\file{dt-croatian.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-croatian.def,package}} -\file{dt-basque.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-basque.def,package}} -\file{dt-serbian.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-serbian.def,package}} -\file{dt-ukraineb.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-ukraineb.def,package}} -\file{dt-bahasa.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-bahasa.def,package}} -\file{datetime.sty}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{datetime.sty,package}} -\file{dt-russian.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-russian.def,package}} +\file{dt-hebrew.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-hebrew.def,package}} \file{dt-icelandic.def}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{datetime.dtx}{dt-icelandic.def,package}} -\file{dt-swedish.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-swedish.def,package}} -\file{dt-austrian.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-austrian.def,package}} -\file{dt-catalan.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-catalan.def,package}} \file{dt-irish.def}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{datetime.dtx}{dt-irish.def,package}} -\file{dt-norsk.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-norsk.def,package}} -\file{dt-german.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-german.def,package}} -\file{datetime.perl}{\nopreamble\nopostamble\from{datetime.dtx}{datetime.perl}} -\file{dt-turkish.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datetime.dtx}{dt-turkish.def,package}} +\file{dt-italian.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-italian.def,package}} +\file{dt-latin.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-latin.def,package}} +\file{dt-lsorbian.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-lsorbian.def,package}} +\file{dt-magyar.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-magyar.def,package}} \file{dt-naustrian.def}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{datetime.dtx}{dt-naustrian.def,package}} +\file{dt-ngerman.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-ngerman.def,package}} +\file{dt-norsk.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-norsk.def,package}} +\file{dt-polish.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-polish.def,package}} +\file{dt-portuges.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-portuges.def,package}} +\file{dt-romanian.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-romanian.def,package}} +\file{dt-russian.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-russian.def,package}} \file{dt-samin.def}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{datetime.dtx}{dt-samin.def,package}} +\file{dt-scottish.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-scottish.def,package}} +\file{dt-serbian.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-serbian.def,package}} +\file{dt-slovak.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-slovak.def,package}} +\file{dt-slovene.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-slovene.def,package}} +\file{dt-spanish.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-spanish.def,package}} +\file{dt-swedish.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-swedish.def,package}} +\file{dt-turkish.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-turkish.def,package}} +\file{dt-UKenglish.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-UKenglish.def,package}} +\file{dt-ukraineb.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-ukraineb.def,package}} +\file{dt-USenglish.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-USenglish.def,package}} +\file{dt-usorbian.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-usorbian.def,package}} +\file{dt-welsh.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{datetime.dtx}{dt-welsh.def,package}} } \endbatchfile -- cgit v1.2.3