[pdftex] pdfcreationdate format(s)

Karl Berry karl at freefriends.org
Wed Dec 6 02:01:37 CET 2017


Hi Thierry,

       D:20171205171912+01'00'
     And that is what the manual describes

Seems I need to change the manual.

     but I have trouble sharing code with some other installs where it
     seems it can output something like
       D:20171205162354Z

I'm not entirely sure, but the relevant code appears to be lines 3052.ff
of web2c/lib/texmfmp.c (in the function makepdftime):

    if (off == 0) {
        time_str[size++] = 'Z';
        time_str[size] = 0;
    } else {
        off_hours = off / 60;
        off_mins = abs(off - off_hours * 60);
        i = snprintf(&time_str[size], 9, "%+03d'%02d'", off_hours, off_mins);
        ...

(where off is the computed timezone offset.)

svn blame tells me that Peter Breitenlohner was the last one to touch
these lines, in r30901, in 2013. Looking at that revision, I surmise
that the code existed before that (in pdftexdir/utils.c?) and he was
just moving things around at that time, but I didn't try to track it
back any further.  I see nothing in any ChangeLog or NEWS files about it :(.

So the actual purpose of differentiating UTC like this, I cannot say
(maybe PDF wants it that way?), but it's apparently been around a long
time. I surmise the reason you are seeing it now is, as Akira said, the
SOURCE_DATE_EPOCH envvar feature added for reproducible build purposes,
which forces the utc interpretation.

So ... it seems to me that the only reliable approach is to be able to
handle either date format in whatever code is looking at the value. They
can't be differentiated by version, as the choice is made at runtime.

Best,
Karl


More information about the pdftex mailing list