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
2
votes
1answer
25 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]{...
5
votes
1answer
72 views

Exctract 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} { ...
2
votes
1answer
41 views

Using the datetime2 package, how do we individually retrieve each of yyyy, yy, mm, dd, mmm, ddd, hhmm, hhmmss, etc.?

Let's say it's now 2019-07-21-082935. If I'm using the datetime2 package, what commands do I use to individually retrieve each of "2019", "19", "07", "7", "JUL", "July", "21", "SUN", "Sun", "Sunday", ...
3
votes
1answer
36 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. ...
0
votes
1answer
25 views

Turn showdow off for one date in document

MRE: % Preamble \documentclass[11pt]{article} % Packages \usepackage[showdow,en-GB]{datetime2} % Document \begin{document} % Turn off showdow \DTMlangsetup{ord=raise,showyear=true,showdow=...
2
votes
1answer
28 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
21 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
2answers
211 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}
1
vote
1answer
52 views

Calculating time spans with datetime2

With datetime2, is there a way to calculate an end time from a start time if I have the duration in minutes? Something like \newcommand*\timespan{90} \newcommand*\starttime{13:45:00} \DTMtime{\...
0
votes
2answers
72 views

datetime2: Formatting the time

How can I get an output of 09:00 AM instead of 9am? \documentclass{article} \usepackage[en-GB]{datetime2} \begin{document} \DTMtime{09:00:00} The desired output is ``09:00 AM" \end{document}
0
votes
1answer
53 views

How to create user defined time table

I have to create a three years work plane, but it still only shows me 4 months, How do I need to do? \documentclass{article} \usepackage{etoolbox} \usepackage{parskip} \...
3
votes
1answer
66 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" ...
7
votes
1answer
397 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 ...
1
vote
1answer
137 views

latex date calculations with datetime2 and ddmm format

I've been trying to to display dates in the format "dd"/"mm" (months preferably roman letters) - however I can't find a single style that supports this requirement. Additionally I'm trying to ...
4
votes
1answer
365 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....
0
votes
2answers
102 views

How to get the datetime2 package to display dates in South African format: “1 April 2018”

By default Latex formats the date as mmm d, yyyy, i.e. in the nonsensical middle endian format. I would like to display it as d Mmm yyyy, e.g. 1 April 2018. I've gone through the datetime2 ...
1
vote
1answer
71 views

datetime2 does not respect polyglossia language settings (using lualatex)

datetime2 does not automatically deduces the correct language from the polyglossia settings. If you set the date style by hand, it works. (datetime2-german is installed.) I'm using lualatex (this ...
1
vote
1answer
85 views

Use output of gitinfo2 package with datetime2 commands

The gitinfo2 package provides the command \gitAuthorDate which returns the date of the current commit in ISO format, e.g., 2018-02-22. I would like to use this date with a different format within in ...
3
votes
1answer
142 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 ...
2
votes
1answer
114 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]{...
4
votes
2answers
477 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 ...
1
vote
2answers
327 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 ...
2
votes
0answers
53 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 ...
3
votes
2answers
193 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 ...
4
votes
2answers
123 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 ...
3
votes
1answer
481 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....
2
votes
1answer
470 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
180 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} \...
1
vote
2answers
283 views

datetime2 doesn't expand months in \DTMDisplaydate

I want to use strings for dates in my document that can be formatted either as ISO or German later on. I looked at isodate datetime and datetime2 most promising seemed to be the latest, but the ...
5
votes
2answers
234 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[...
3
votes
0answers
154 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 ...
3
votes
1answer
168 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 ...
1
vote
2answers
695 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
156 views

Expansion of argument to DTMdate function in datetime2

I need a very simple associative array for my project which I am trying to implement as in the following MWE. Two questions please: How do I need to tweak my \alistget macro to allow its result to ...
1
vote
1answer
150 views

Change the case of datetime2 month return

I'm trying to automate report generation in czech. In english, there is no problem using solution from this thread. Same behaviour is for \monthname command from datetime package. The problem is, ...
1
vote
1answer
99 views

datetime2 define dates “globally” outside of \begin{document}

When using the datetime package, I could define dates "globally" like this: \newdate{sample}{03}{09}{2016} \begin{document} \displaydate{sample} \end{document} Can anyone tell me, how this is ...
5
votes
2answers
2k 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 \...
2
votes
1answer
72 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[...
0
votes
1answer
374 views

“datetime” to “datetime2”

I just updated to the "datetime2" package. I live on the east coast of the United States, and used the "\usdate" directive with "datetime". That apparently doesn't work with "datetime2" I installed ...
2
votes
1answer
44 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 ...
3
votes
3answers
654 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} ...
4
votes
1answer
136 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 ...
1
vote
0answers
93 views

Using datetime2 to automatically update dates?

I've been wondering if the following things are possible entirely within LaTeX using the datetime2 package (at the moment I'm using the python package and an external text file to create tables of ...
3
votes
1answer
340 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 ...
1
vote
1answer
450 views

Display custom date in the correct regional style with datetime2

I'm trying to get datetime2 to display a custom date in the proper regional style, either using the language setting defined through polyglossia, or by passing the language setting through datetime2 ...
3
votes
1answer
120 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 ...
2
votes
1answer
663 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 ...
5
votes
2answers
404 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 ...
2
votes
1answer
137 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 ...
4
votes
2answers
152 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 ...