I want to simply insert an arbitrary date (in my case March 16, 2015) in a way that does not hard code the date format.
That is, I want something like
\insertdate{<year}{<month>}{day}
For example:
\insertdate{2015}{03}{16}
which with the English configuration can insert
March 16, 2015
… but with for example Norwegian settings (given that month names and style are available) can insert
16. mars, 2015
I do not need (or want) a reference to the date after it is inserted, only that the format is not hard coded. I've found this related question, but find it hard to believe that what I want cannot be done out of the box.
- Is there a package that lets me insert a general date and formats the date based on locale settings?
- Is there an easy way to change the locale settings for this package?
Best Answer
The
datetime
package can give you the desired result using\date<language>
and\formatdate
. A little example: