1

I am using usual method to prepare pdfinfo with date conversion:

\def\convertDate{%
    \getYear
}

{\catcode`\D=12
 \gdef\getYear D:#1#2#3#4{\edef\xYear{#1#2#3#4}\getMonth}
}
\def\getMonth#1#2{\edef\xMonth{#1#2}\getDay}
\def\getDay#1#2{\edef\xDay{#1#2}\getHour}
\def\getHour#1#2{\edef\xHour{#1#2}\getMin}
\def\getMin#1#2{\edef\xMin{#1#2}\getSec}
\def\getSec#1#2{\edef\xSec{#1#2}\getTZh}
\def\getTZh +#1#2{\edef\xTZh{#1#2}\getTZm}
\def\getTZm '#1#2'{%
    \edef\xTZm{#1#2}%
    \edef\convDate{\xYear-\xMonth-\xDay T\xHour:\xMin:\xSec+\xTZh:\xTZm}%
}

\expandafter\convertDate\pdfcreationdate 

However this doesn't work for me. I am using Overleaf with pdfLaTeX compiler.

Error is

Use of \getTZh doesn't match its definition.

<inserted text> D:20190304112428Z

l.155 \expandafter\convertDate\pdfcreationdate

I am guessing it has to do with the "Z" at the end. But why is "Z" there? There should be +01'00' there.

1

I figured it out just after posting the question. Overleaf needs the time zone set. This is an example.

It works now.

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.