# Convert \pdfcreationdate to pdfa-1b pdfinfo

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.