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
35 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> ...
6
votes
1answer
281 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 ...
1
vote
1answer
39 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{...
8
votes
1answer
460 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 ...
4
votes
1answer
100 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} \...
-1
votes
1answer
34 views

Get HH:MM:SS from datetime2 by giving seconds [duplicate]

I search a command that give formated time like HH:MM:SS when I give just seconds. As example, if the search command is \formatetime{}, it should give the following result: \formatetime{50} % should ...
4
votes
2answers
99 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 ...
2
votes
1answer
75 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{...
1
vote
1answer
54 views

Add days to a specific date in datetime2 in a for loop / foreach loop

I want to calculate the beginning and ending date of a week (first day is Monday, last is Sunday). This is working fine for a single date. Now I want to calculate the start and end of multiple weeks ...
0
votes
0answers
10 views

Year calculations with datetime2 and pgfkeys

I would like to add years to a given date (without having to care about leapyears). I should be able to define the date via pgfkeys and after that add years to this date. For example 01.01.2020 -> +...
0
votes
1answer
33 views

datetime2: future dates in a specific (ad hoc) format

I've seen these posts ... Changing date format in datetime2 latex date calculations with datetime2 and ddmm format ... and in theory I ought to be knowing what to do, yet... I am not. Instead... I'm ...
0
votes
1answer
27 views

How could work `\spanishdatedel` with datetime2 package

I'm asking if is possible to use \spanishdatedel commmand of babel-spanish package. \documentclass{article} \usepackage[english,spanish]{babel} \spanishdatedel \usepackage{datetime2} \DTMsetup{...
4
votes
1answer
53 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} \...
0
votes
1answer
39 views

datetime2 - Display Daterange

Is it possible to display a daterange with datetime2 like in isodate? isodate automatically calculates the correct difference and displays the correct range. However, datetime2 has the correct display....
0
votes
0answers
61 views

Make documents where the date printed on the document is automatically the date of creation of document

Is there a way to create latex documents where the date printed on the documents is always by default the date of creation of the document? I don't want to compile the same latex file 30 days later ...
3
votes
1answer
83 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}...
2
votes
1answer
47 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 ...
5
votes
2answers
98 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 ...
2
votes
1answer
102 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]{...
6
votes
1answer
154 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} { ...
1
vote
1answer
67 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
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. ...
0
votes
1answer
33 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
52 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
36 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
739 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
79 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{\...
1
vote
2answers
196 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
74 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} \...
4
votes
1answer
237 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
544 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
324 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 ...
5
votes
1answer
781 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
175 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
130 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
126 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
285 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
182 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]{...
5
votes
2answers
819 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
459 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
88 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
328 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
189 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
608 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
623 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
317 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
424 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
270 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
176 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
193 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 ...