datetime FAQ (v1.76)
Topics
- General Queries
- How do I change the date separator for numerical dates?
- How do I change the time separator for numerical times?
- How can I save a date for later use?
- Is there multilingual support for the days of the week?
- Is there multilingual support for \textdate?
- Why is there only limited multilingual support?
- How can I set up a different set of default package options?
- How do I make just the year appear?
- Unexpected Output
- A space appears after \currenttime
- The date is in another language or in the wrong format
- \pdfdate is incorrect between 00:00 and 00:59
- The month name always appears in English regardless of the current language setting
- Package Errors
- \currenttime causes a problem in the argument of certain commands
- \today causes a problem in the argument of certain commands
- \longdate etc cause a problem in the argument of certain commands
- Undefined control sequence \ier
- Unknown language 'english' error
- \textdate causes an error
- LaTeX2HTML support
General Queries
How do I change the date separator for numerical dates?
The default date separator for numerical dates is / as from version 2.43, this can be changed by redefining \dateseparator.
How do I change the time separator for numerical times?
As from version 2.43, this can be changed by redefining \timeseparator.
How can I save a date for later use?
As from version 2.45, you can save a date using \newdate. See the datetime documentation for details.
Is there multilingual support for the days of the week?
Currently there is only support for English, French, Portuguese and Spanish, and as from version 2.5, there is also support for German (thanks to Uwe Bieling for supplying this.)
If you want support for another language, please send me the equivalent of the following code, replacing english with the language name (as used by babel) and replacing Sunday etc with the appropriate translations (including accent commands etc):
\providecommand{\dayofweeknameidenglish}[1]{%
\ifcase#1\relax
\or Sunday%
\or Monday%
\or Tuesday%
\or Wednesday%
\or Thursday%
\or Friday%
\or Saturday%
\fi}
\providecommand{\shortdayofweeknameidenglish}[1]{%
\ifcase#1\relax
\or Sun%
\or Mon%
\or Tue%
\or Wed%
\or Thu%
\or Fri%
\or Sat%
\fi}
Is there multilingual support for \textdate?
\textdate was defined before multilingual support was added, and so uses the English style of writing a textual date, which won't be appropriate for other languages, so it won't look right if used if the current language is not English. If you want to write your own textual date format, you need to bear in mind that the fmtcount package (which is used to convert numbers and ordinals into words) only has very limited multilingual support, and see also the previous answer.
Why is there only limited multilingual support?
Because there is a limit to the number of languages I can speak! I am therefore dependent on people supplying me the information for all the other languages.
How can I set up a different set of default package options?
Create a file called datetime.cfg, and put the appropriate commands in it. Then save it to somewhere on the TEX path.
How do I make just the year appear?
\the\year
Unexpected Output
A space appears after \currenttime
This has been fixed in version 2.46.
The date is in another language or in the wrong format
Make sure you are using at least version 2.49 of the datetime package, and at least version 1.07 of the fmtcount package. If you are using UKenglish or USenglish, make sure you are using at least version 2.53 of the datetime package.
Remember also that you must load babel before loading the datetime package.
\pdfdate is incorrect between 00:00 and 00:59
This has been fixed in version 2.48.
The month name always appears in English regardless of the current language setting
This has been fixed in version 2.55.
Package Errors
\currenttime causes a problem in the argument of certain commands
See next answer.
\today causes a problem in the argument of certain commands
The datetime package redefines \today which made it a fragile command. In versions prior to 2.46, you need to \protect it. As from version 2.46, it has been made a robust command. The same also applies to declarations which change the date format (e.g. \longdate), and also \currenttime.
\longdate etc cause a problem in the argument of certain commands
See the previous answer.
Undefined control sequence \ier
Make sure you are using at least version 2.49 of the datetime package, and at least version 1.06 of the fmtcount package.
Unknown language 'english' error
Make sure you are using at least version 2.49 of the datetime package, and at least version 1.06 of the fmtcount package.
\textdate causes an error
You are probably using an old version of datetime with a new version of fmtcount. Please download and reinstall.
LaTeX2HTML support
Why does LaTeX2HTML ignore datetime.cfg?
Because I haven't worked out how to do it.
Why are some languages supported in datetime.sty but not in the LaTeX2HTML version?
Because they are not supported by the LaTeX2HTML implementation of the babel package.