Latest news 2024-09-23: new blog post "Tales for Our Times: Raising Funds and Awareness for St Martins Housing Trust".

datetime package (obsolete) FAQ

This is the FAQ for the obsolete datetime package. This package has been replaced by datetime2.

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.

2020-07-03 12:09:35

Top

How do I change the time separator for numerical times? 🔗

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

2020-07-03 12:09:45

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.

2020-07-03 12:10:06

Top

Is there multilingual support for the days of the week? 🔗

There is only limited support for the days of the week. Not all languages have the day names provided.

2020-07-03 12:10:59

Top

Is there multilingual support for \textdate? 🔗

No, \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 when 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 Is there multilingual support for the days of the week?.

2020-07-03 12:11:54

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.

2013-12-08 16:57:16

Top

Why is the default format UK English? 🔗

I originally wrote datetime as an alternative to the ukdate package, which isn’t in the major TeX distributions. The datetime was only intended as a UK date formatting package, but after repeated requests, I added multi-lingual support. The UK format remained as the default.

2020-07-03 12:13:30

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. However, if you share your document code with other people, make sure you also supply your custom datetime.cfg file if it’s important that they replicate your date and time format.

2020-07-03 12:13:58

Top

How do I make just the year appear? 🔗

You don’t need datetime for this. Just use \the\year.

2020-07-03 12:14:22

Top

Why can’t my package manager find datetime.sty? 🔗

The datetime package has been made obsolete. The replacement package is datetime2.

Obsolete packages remain available in the CTAN obsolete tree. Your TeX distribution may not contain some obsolete packages. If this is the case, you will need to download datetime.sty from CTAN and manually install.

It’s your choice if you want to continue to use an obsolete package, but you should be aware that any issues with unmaintained packages won’t be fixed.

2020-07-03 12:15:11

Top

Unexpected Output

A space appears after \currenttime 🔗

This has been fixed in version 2.46.

2020-07-03 12:15:22

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.

2020-07-03 12:16:20

Top

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

This has been fixed in version 2.48.

2020-07-03 12:16:32

Top

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

This has been fixed in version 2.55.

2013-12-08 17:09:44

Top

Package Errors

\currenttime causes a problem in the argument of certain commands 🔗

In versions prior to 2.46, you need to \protect it. As from version 2.46, \currenttime has been made a robust command.

2020-07-03 12:17:03

Top

\today causes a problem in the argument of certain commands 🔗

In versions prior to 2.46, you need to \protect it. As from version 2.46, \today has been made a robust command. The same also applies to declarations which change the date format (e.g. \longdate), and also \currenttime.

2020-07-03 12:17:41

Top

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

In versions prior to 2.46, you need to \protect it. As from version 2.46, \longdate etc have been made robust.

2020-07-03 12:18:07

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.

2020-07-03 12:18:34

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.

2020-07-03 12:18:57

Top

\textdate causes an error 🔗

You are probably using an old version of datetime with a new version of fmtcount.

2020-07-03 12:19:25

Top

LaTeX2HTML support

Why does LaTeX2HTML ignore datetime.cfg? 🔗

Because I haven’t worked out how to implement it.

2020-07-03 12:19:52

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.

2020-07-03 12:20:21

Top