About
LaTeX
Free Software
Books
News
Contact

datetime FAQ (v1.76)

Topics



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.

Top

How do I change the time separator for numerical times?

As from version 2.43, this can be changed by redefining \timeseparator.

Top

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.

Top

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}

Top

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.

Top

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.

Top

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.

Top

How do I make just the year appear?

\the\year

Top

Unexpected Output

A space appears after \currenttime

This has been fixed in version 2.46.

Top

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.

Top

\pdfdate is incorrect between 00:00 and 00:59

This has been fixed in version 2.48.

Top

The month name always appears in English regardless of the current language setting

This has been fixed in version 2.55.

Top

Package Errors

\currenttime causes a problem in the argument of certain commands

See next answer.

Top

\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.

Top

\longdate etc cause a problem in the argument of certain commands

See the previous answer.

Top

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.

Top

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.

Top

\textdate causes an error

You are probably using an old version of datetime with a new version of fmtcount. Please download and reinstall.

Top

LaTeX2HTML support

Why does LaTeX2HTML ignore datetime.cfg?

Because I haven't worked out how to do it.

Top

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.

Top

© 2012 Dickimaw Books. "Dickimaw", "Dickimaw Books" and the Dickimaw parrot logo are trademarks. The logo was derived from a painting by Magdalene Pritchett.