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?
- 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?
- Why is the default format UK English?
- How can I set up a different set of default package options?
- How do I make just the year appear?
- Why can’t my package manager find datetime.sty?
- Unexpected Output
- Package Errors
- LaTeX2HTML support
General Queries
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
As from version 2.43, this can be changed by redefining \timeseparator
2020-07-03 12:09:45
As from version 2.45, you can save a date using \newdate
. See the datetime documentation for details.
2020-07-03 12:10:06
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
\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
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
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
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
You don’t need datetime for this. Just use \the\year
.
2020-07-03 12:14:22
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
Unexpected Output
\currenttime
🔗This has been fixed in version 2.46.
2020-07-03 12:15:22
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
\pdfdate
is incorrect between 00:00 and 00:59 🔗This has been fixed in version 2.48.
2020-07-03 12:16:32
This has been fixed in version 2.55.
2013-12-08 17:09:44
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
\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
\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
\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
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
\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
LaTeX2HTML support
Because I haven’t worked out how to implement it.
2020-07-03 12:19:52
Because they are not supported by the LaTeX2HTML implementation of the babel package.
2020-07-03 12:20:21