Questions tagged [datetime2]

The `datetime2` package provides commands for formatting dates, times and time zones and redefines `\today` to use the same formatting style.

Filter by
Sorted by
Tagged with
12
votes
2answers
1k views

Change month names in \today command

The \today command will print the Latin name of the month with the nynorsk language option. I would like to change this by using the more traditional (and still very commonly used in speech) system of ...
9
votes
3answers
2k views

How do I extract a month name in datetime2?

In datetime, there was a macro which provided the long name of the month, so if I have saved a date as, say, gitdate, I can extract the month name by: \monthname{\getdatemonth{gitdate}} Is there ...
9
votes
1answer
469 views

A professional stamp in relief

Related to these previous my questions A special annulment (i.e., cancellation) of a stamp and Date time in two rows in Italian format and time zone I have created another MWE to have some different ...
7
votes
1answer
551 views

Remove the leading zero from date

I like to print dates formatted in this way: 6 October 2018. Usually, I just type the date by hand. But I tried to set things up so that \today would format dates the way I like. I must have only ...
6
votes
1answer
284 views

Abbreviations of Weeknames in German

This is pretty straight-forward. I have finally managed to abbreviate weeknames in “British”, i.e. en-GB. (What I need is ngerman) But, as I'm working on a German document, I need the date format ...
6
votes
1answer
162 views

Extract year, month, day from datetime2

I have made a command that looks like this: \newcommand*{\numdash}{\,--\,} \ExplSyntaxOn \NewDocumentCommand{\dateRange}{mmmmmm} { \str_case:nnF { #1 } { {#4} { ...
6
votes
2answers
3k views

Formatting datetime2 in LaTex to 4th September, 2016 without the current day?

I'm currently using \usepackage[UKenglish]{babel} \usepackage{datetime} and I'm getting Sunday 4th September, 2016 with the commands \today or with \newdate{example}{01}{09}{2016} (outside of \...
6
votes
1answer
678 views

How does showdow work in datetime2?

Since datetime is no longer getting bug fixes, I've been looking at the possibility of switching to datetime2. However, aside from the fact that I'd need to write my own language module, I can't even ...
5
votes
2answers
273 views

Date format changed by loading pdfcomment package

It seems by loading the pdfcomment package, the date format is implicitly changed to YYYY-MM-DD. Consider the following MWE: \documentclass[12pt]{scrartcl} \usepackage[american]{babel} \usepackage[...
5
votes
2answers
110 views

Command \nr already defined (datetime2 and nccmath incompatibility)

It seems that the datetime2 and the nccmath packages are incompatible when I load the [useregional] option in the first (I get command \nr already defined). I used a solution for reducing spacing ...
5
votes
1answer
264 views

datetime2: scientific english format

I'd like to typeset dates with the datetime2 package in English in the format commonly used in scientific or technical writing, that is: time in 24-hour format; dates in the format: "29 October 2018" ...
5
votes
2answers
625 views

Replicate behavior from datetime package with datetime2 package

The datetime package is now obsolete and I would like to switch to the newer datetime2 pacakge, but I am having trouble recreating the behavior that I used the datetime package for. The following MWE ...
5
votes
1answer
814 views

How to automatically set CreationDate on PDF

When compiling a document using pdflatex one can set the PDF CreationDate of the document using \pdfinfo{...}. I would like to automatically set this to the date supplied to \date{...} in the document....
5
votes
2answers
856 views

datetime2: define and explicitely use date formats

As datetime is superseded by datetime2, I'm struggling hard to achieve the following using the new package: In an English document, I would like to show the current date (\today) once like this 20th ...
4
votes
2answers
252 views

datetime2, norwegian day of week missing

I have tried to figure out how to enable printing the day of week, but I cannot seem to be able to do this for norwegian. It works fine for British. I do realize that it might be because it is ...
4
votes
2answers
195 views

store a date with datetime2 and use it with termcal

I am making a class syllabus using the "termcal" package and would like to store the starting date for the first class so I can use it for different elements of the syllabus. I am currently trying to ...
4
votes
2answers
102 views

Date without year

I would like the dates language within a document controlled by package. It seems that datetime2 is the only contemporary package doing this stuff. However, occasionally I need only to display day ...
4
votes
1answer
104 views

Date time in two rows in Italian format and time zone

I have now created this MWE: \documentclass[12pt,margin=3mm]{standalone} \usepackage{newtxtext} \usepackage[dvipsnames]{xcolor} \usepackage{tikz} \usepackage{datetime2} \usepackage{fontawesome5} \...
4
votes
1answer
528 views

Change to short Monthname in datetime2 (german)

I use \usepackage[ngerman]{datetime2} and try to create a date which uses the short form of the Monthname. When I type \DTMdate{2016-12-4} I get as result 4. Dezember 2016. But I want the short ...
4
votes
1answer
59 views

How can I convert a datetime month name to uppercase?

I'm trying to create a date style that results in 01 JUN 2020 \documentclass{article} \usepackage[USenglish]{babel} \usepackage[showseconds=false,useregional=text,calc]{datetime2} \...
4
votes
1answer
198 views

Problem using the acro-package and \today

I have a problem using the tooltip option of the acro-package and the command \today. In my document i load \usepackage[tooltip = true]{acro}, where the option tooltip=true loads the package ...
4
votes
1answer
2k views

Where can I get datetime2.sty or what is CTAN?

I am trying to build a huge latex project on my system - I downloaded everything, and did not touch anything. XeLaTeX tells me that datetime2.sty is missing, and I guess I just have to download it, ...
3
votes
1answer
302 views

How to specify a date and make calculations with it in datetime2?

I want to specify a date (and give it a name) in a master header TEX-file, then refer to that date in several independent daughter files. As this doesn't even work within a single file, this ...
3
votes
2answers
349 views

How to calculate previous month from \today using datetime2?

Is is possible to use datetime2 to calculate the previous month from \today? (Alternatively another package). I've found some solutions that use negative deduction of days, but that would cause ...
3
votes
1answer
611 views

Pdflatex fails when using datetime package

I have been debugging a class that uses the datetime package. It seems the offending statement is a \RequirePackage{datetime}. It seems that including the datetime package is causing pdflatex to fail....
3
votes
1answer
331 views

datetime2 — Warnings when using showyear setting

With the following MWE, I get two warnings: \documentclass{article} \usepackage[en-US]{datetime2} \begin{document} \DTMlangsetup{showyear=false} \DTMdate{2017-03-13} \DTMlangsetup{showyear=true} \...
3
votes
1answer
200 views

Get full iso format date and time with colon and “T” separator

When I use iso style with datetime2 package, I exepect to get the full date format with T separator between date and time and colon “:” between hours, minutes, and seconds. I expect someting like ...
3
votes
3answers
1k views

Add (n) days to variable date

I'm trying to add a variable date to a variable number. I'm currently trying to use the datetime2 package. I'm trying to get something like this (not actually working): \documentclass[10pt]{article} ...
3
votes
1answer
93 views

Warning: Date-Time Language Module `nynorsk' not installed

I am working through the warnings and errors of a project of mine. One error that has been bugging me is in regards to the datetime2 package. The following code \documentclass[margin=1mm]{standalone}...
3
votes
1answer
50 views

mixing date formats in the same document

I am trying to make dates in my CV uniform so I thought of using the datetime2 package. The problem is that sometime I have a full date, sometimes the year and the month, and sometimes only the month. ...
3
votes
1answer
142 views

scrlttr2 document fails with datetime2 package

When using the datetime2 package in a scrlttr2 document, I get the error: /usr/share/texlive/texmf-dist/tex/latex/datetime2/datetime2.sty:368: LaTeX Error: \today undefined. See the LaTeX ...
3
votes
1answer
645 views

Titling package and date formatting

I am using the titling package the resuse the defined date etc. using a plain \thedate command. However the date format is not what I need because of different type of localization. My first shot was ...
3
votes
1answer
359 views

How should language aliases be used with datetime2?

Consider the following code: \documentclass[british]{article} \usepackage{babel} \usepackage[utf8]{inputenc} \usepackage{datetime2} \DTMsetup{useregional} \DTMlangsetup[en-GB]{ord=raise} \begin{...
3
votes
0answers
177 views

Datetime2 package example usage for new era definition

Background I want to create a timeline that is based on years, but I don't want to handle a mix of negative and positive numbers (i.e. BC/AD which gives us this year as 2016 and 4032 years ago is ...
2
votes
1answer
80 views

Localization for \date command

How can I apply localization for the \date command? For now it seems to just display an arbitrary string. \documentclass{article} \author{me} \date{bla bla bla} \begin{document} \maketitle \end{...
2
votes
1answer
37 views

Changed hyperxmp or hyperref causing error with pdfdate={\today}

The following used to be OK. With the most recent release of hyperxmp, it no longer does, giving error: ./hypersetup-bug.tex:9: Argument of \hyxmp@pdf@to@xmp@date has an extra }. <inserted text> ...
2
votes
1answer
44 views

typesetting \today in local numeric and textual form

The datetime2 docs are hard to read. I just want to typeset \today's date, both numerically and textually, in the correct way, depending on the babel language setting. Here is my MWE: \documentclass{...
2
votes
1answer
966 views

Help with US Date Format

I have searched the isodate package and the datetime2 package to answer my question. I would like my date to be mm/dd/yyyy. The closest I have gotten is to have the date as dd/mm/yyyy. Could someone ...
2
votes
1answer
110 views

Change date style when using regional settings in datetime2

I can't seem to change datetime2's settings when using the option useregional to display the date in the language given to babel \documentclass{article} \usepackage[T1]{fontenc} \usepackage[italian]{...
2
votes
1answer
38 views

Combine datetime2 and csvsimple

How can I make the following code compile: \documentclass{standalone} \usepackage{csvsimple} \usepackage{datetime2} \usepackage{filecontents} \begin{filecontents*}{test.csv} a,b 2019,00:00:00 2019,...
2
votes
1answer
799 views

Changing date format in datetime2

Using the datetime2 package, how do I tell \today to display the date in the format: 'Fri, March 1, 2019'? \documentclass{article} \usepackage{datetime2} \begin{document} \today \end{document}
2
votes
1answer
191 views

\DTMsavedate calculation does not work with \DTMusedate

I would like to calculate a new date based on a previous one with \DTMusedate, but I got an error from \@dtm@parsedate. Here's a sample : \documentclass[a4paper]{article} \usepackage[calc]{...
2
votes
1answer
83 views

Change pre-defined date in command and save to datetime2 - expansion issue?

A date is predefined in the format 12 June 2015 and I need package datetime2 to modify the date and translate it in other languages. However, it does not work in the following way: \documentclass[...
2
votes
1answer
52 views

datetime2's \DTMsavetimestamp can't read from macro - expansion or catcode issue?

What already works I am using \immediate\write18 to let the GNU date command do some date/time arithmetic. The resulting timestamp in ISO format (e.g., 2011-09-09T09:59:59Z) is written to a temporary ...
2
votes
1answer
49 views

“Hidden text” inflates `widthof`

French letters call for a heading stating place and date, which I put in \letterlieudate, which I put in a minipage. Requirement: that the minipage's width be just big enough so that \letterlieudate ...
2
votes
1answer
53 views

datetime2: Assuming missing inputs of minutes or seconds to be zero

I would like to make the following document print output of 07:00 PM. \documentclass{article} \usepackage[calc,english]{datetime2} \DTMnewtimestyle{ampm}{% % \DTMdisplaytime{<hh>}{<mm>}...
2
votes
1answer
154 views

Package tracklang Error: Dialect `iso' is not predefined

I added the package datetime2 so i could write out the todays time in the ISO standard. \usepackage[iso]{datetime2} I get a error saying that iso is not predefined. datetime2.sty 159 Package ...
2
votes
0answers
90 views

Listing Schedules By Week and by Specific Dates Using `datetime`

I am using datetime to automatically generate a schedule. The MWE at the moment allows me to list weeks (and dates of the beginning and the end of each weak). But I would like to combine this with ...
1
vote
2answers
998 views

Use swedish format in datetime2

I'm trying to use swedish date format by when using the package datetime2. I have found the following link https://www.ctan.org/pkg/datetime2-swedish but I don't understand how to call for this one. ...
1
vote
2answers
471 views

Input a date to `datetime2` in a format different than iso

Having a date stored in a macro: \def\Mydate{20-12-2017} I would like to do some calculations (advance days/months) using datetime2. If \Mydate stores the date in yyyy-mm-dd I won't have issues, but ...