0

I've seen these posts ...

... and in theory I ought to be knowing what to do, yet... I am not. Instead... I'm lost!

I don't want to change the general Format of the way the date is beeing displayed (that for the 1st example), but I do want to get a Future date (in 5 days), but not in the Format I get from the 2nd example.

So if today is June 29th of 2020 (ISO 2020-06-29) and I want the date 5 days in the future I should get july 4th (I see I can do this with datetime2), but be able to format the ouput ad hoc and not change it for the whole document.

Now I would like to be able to have (in abstract) something like this:

\offsetdate{opffset}{dateformat}{seperator}

... respectivly to do like this:

\offsetdate{5}{ddmmyyyy}{.}

to get 05.07.2020

\offsetdate{5}{dmyyyy}{.}

to get 5.7.2020

\offsetdate{5}{yyyymmdd}{}

to plainly get 20200704

Any hints will be greatly appreciated!

2
1

from --

http://ctan.mirror.garr.it/mirrors/CTAN/macros/generic/texdate/texdate.pdf

and --

Date format: YYYY-MM-DD

enter image description here

\documentclass{article}
\usepackage{texdate}
\begin{document}
%\initcurrdate
%\printfdate{ISOext}

\initdate{2019}{6}{24}
\printfdate{ISO}
\printfdate{ISOext}\par 

\advancebydays{8}
8 days later: \printfdate{ISO}\par
\end{document}

Addendum -- with reference to the OP example requirement of 29 Jun 2020

enter image description here

\documentclass{article}
\usepackage{texdate}
\begin{document}

\initdate{2020}{6}{29}
\advancebydays{5}

5 days later: 

|ISO date|:\printfdate{ISO}\par

\def\setdateformat{d\ B\ Y}
|d\ B\ Y|: \printdate\par
\def\setdateformat{d.m.Y}
|d.m.Y|: \printdate\par
\def\setdateformat{a,\ d\ b\ Y}
|a,\ d\ b\ Y|: \printdate\par
\printfdate{ISOext}\par
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.