• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Oddness in PDF timestamp metadata fields?

Community Beginner ,
Nov 07, 2022 Nov 07, 2022

Copy link to clipboard

Copied

Our org has a small collection of PDFs from which we pulled the timestamp metadata, to help track how old a given PDF really is... file server timestamps can change depending on when a file was last copied, moved, etc.

Fair enough. But I don't understand what I'm looking at; it doesn't seem to make sense.

An older PDF has a XMP metadata Create timestamp of: 2011-09-18T16:27:50-04:00

But if one views this PDF's Properties within Acrobat, it gives the Create time as:  9/18/2006 3:27:50 PM  (i.e., 15:27:50)

Why is there a one hour difference?

As I understand it, Acrobat stores timestamps with offsets that basically mean, in this example, the PDF was "created at 9/18/2011 16:27 local time, and that local time was 4 hours behind Zulu Time". (See this for a little more background on its XMP timestamps.)

Okay; this sounds fine. But still,

Why's it showing one hour difference between its Property popup and its own XMP data?

Could it be because of Daylight Savings Time? DST would indeed have been in effect at that time and place; the PDF was most likely made on the U.S. East Coast, and September is during DST. This makes it be -4 relative to Zulu instead of the usual -5.

But even if the Properties are "quietly decoding" the DST difference, um ... how can it even do that? Does it keep a lookup table somewhere of all historical DST differences that have ever existed, so it knows how to handle this? That would seem super awkward.

And it still would not have been the actual local time anyway... wouldn't that have been 4:27 PM?

So why doesn't the Properties popup just say 4:27 PM??

I must be missing something. Can anyone help?

TOPICS
Acrobat SDK and JavaScript

Views

4.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Nov 07, 2022 Nov 07, 2022

Copy link to clipboard

Copied

quote

An older PDF has a XMP metadata Create timestamp of: 2011-09-18T16:27:50-04:00

But if one views this PDF's Properties within Acrobat, it gives the Create time as:  9/18/2006 3:27:50 PM  (i.e., 15:27:50)

Why is there a one hour difference?

If I read your dates correctly, it's not merely a one hour difference but instead a five years and one hour difference.

One hour might be explainable by DST or other time zone effects, but five years?

 

Consider looking into the PDF once again, there is not only the XMP metadata but also an Info dictionary which can also contain a creation date. Maybe the two places with a creation date simply are not in sync...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 07, 2022 Nov 07, 2022

Copy link to clipboard

Copied

Hi - My bad - it is 2006 in both places... I had accidentally copied just the year wrong, from the last modified timestamp. Arg, I don't see a way to edit my OP.

I can put the "Additional Metadata" popup right next to the original Properties popup. It shows a one hour difference. I don't see how that can be. It shows this for both the Create and Modify timestamps... relative to what is shown in the Properties popup, it is one hour later at the bottom of the Additional Metadata (and if you drill down to the XMP data, and if we copy metadata out of our PDF collection into a dataset).

I don't understand how this can be. Surely it must make sense somehow. But how?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 07, 2022 Nov 07, 2022

Copy link to clipboard

Copied

Acrobat doesn't have to do this. It may well be asking the system to format the date for the local time zone (based on knowing what it was in GMT/UTC). The system certainly knows about past and future daylight savings. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 07, 2022 Nov 07, 2022

Copy link to clipboard

Copied

Uh... what is it that you're saying it doesn't have to do? I don't even know what it is doing. Is it doing some DST transform, even when that would not be the actual time when it was created or modified locally? Why would it do that? Why show it as two separate times? 

 

I don't understand what's going on here. Can someone explain?

 

Here's a screen cap of the initial Properties popup (on left) next to the bottom of the Additional Metadata popup (on right):

TheRedKnightMike_0-1667844280478.png

 

And here it is in Additional Metadata / Advanced / XMP Core Properties of the same PDF:

 

PDF timestamp metadata for OC 10 Dichlorobenzenes No 2.PNG

This latter (the XMP) is what we get if we extract metadata from the PDFs. But then I see it's not what it actually shows in Properties (see above). Why? Stated another way: I would like for people using the app I'm developing to actually see what the PDF says when you look at its Properties. So I need to know why it's different. And exactly when it will or won't be off by an hour... or whatever else might be going on.

 

What does it think it's showing in the two places? What is the one, and what is the other? And why is it doing that?

 

Thanks if anyone can help!

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Nov 07, 2022 Nov 07, 2022

Copy link to clipboard

Copied

As mentioned in my original comment, have you checked the internals of the PDF? In particular, does the Info dictionary also contain a created date? And if it does, is it different from the date in the xmp metadata?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 07, 2022 Nov 07, 2022

Copy link to clipboard

Copied

Hi, I apologize, but I don't know what you mean by "the internals of the PDF". I also don't know what you mean by the Info dictionary.

I'm not an Acrobat dev, even though I posted this in the Acrobat SDK forum. My reasoning is that the metadata is sort of beneath the hood, whereas the main Acrobat forum has thousands of "how do I save/edit/etc. a PDF" questions. And my very technical question wouldn't be well served there.

I hoped that there was a simple answer to the discrepancy I'm seeing, that people familiar with Acrobat under the hood could probably quickly answer. But it seems I could be wrong.

If you can tell me what to look for, I can look for it. I don't see any other internal timestamps for this PDF on the Acrobat menu, though. But ...

I see that Test Screen Name (a user here) just wrote that I may be assuming Acrobat is responsible, when it isn't. I can accept that that's certainly possible. But a priori it was also possible that I was missing something simple either with Acrobat, or with time zones. Know what I mean? So I posted this question.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Nov 07, 2022 Nov 07, 2022

Copy link to clipboard

Copied

quote

Hi, I apologize, but I don't know what you mean by "the internals of the PDF". I also don't know what you mean by the Info dictionary.

If you have an example file with that discrepancy you can share, please do so, then people here can check those internals.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 09, 2022 Nov 09, 2022

Copy link to clipboard

Copied

Hi, here's the PDF I took the screencaps from. AFAIK nobody has done anything funky with this document; they're just PDF output from probably MS Word.

 

I'm pretty sure I've seen the discrepancy in some of the other ~800 PDFs in our little library, but I did a full stop the moment I saw this head scratcher. A.k.a., "wth is going on with this timestamp?" when we need to use the metadata to display what folks expect to see in Properties.

 

really appreciate your help here. And apologies for my rambling replies. I had hoped there would be some quick, known bug and/or feature, or maybe just me straight-up missing something.

 

There are only so many rabbit holes one can go down when behind on a dozen projects, ya know? A glaring discrepancy in timestamps within a document is ... unanticipated, laugh.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Nov 09, 2022 Nov 09, 2022

Copy link to clipboard

Copied

Thanx for sharing the file.

First of all, my guess was wrong, the time in the Info dictionary is D:20060918162750-04'00', so it's the same as the XMP date 2006-09-18T16:27:50-04:00.

What I see in the Adobe Acrobat document properties dialog, though, is:

image.png

It looks like that output simply takes the creation date from the file and adapts it to the viewer's current time zone (here CET, +01:00). Has yours been -05:00 when you observed all this?

As TestScreenName mentioned, though, it is not clear whether this is an explicit decision by Adobe or whether this is a side effect of using some date-to-string function of the OS or some other third party..

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 10, 2022 Nov 10, 2022

Copy link to clipboard

Copied

Thanks then ... as soon as I get the time, I'll see how some of the other PDFs display the time, relative to the time offset in their metadata timestamps. If they're all simply converting the local time it was created to my time zone, then I guess that answers that. Yes, I am in time zone -5 (Eastern U.S. time). 

Let me give it a look.

I greatly appreciate you and Test Screen Name helping out. Thanks!!

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 14, 2022 Nov 14, 2022

Copy link to clipboard

Copied

LATEST

++ ADDING TO THIS INTERESTING TOPIC,

 

Both @Test Screen Name and @MikelKlink are correct with this observation.

 

The oddness that you've observed is not really that odd, it is in fact normal.

 

What makes it odd is the misconceptions and confusions around the complexity that surround how XML schemas get that information from, and how that information is distributed by different computer systems and organizations accross the globe.

 

In fact, file creation dates will vary based on  whatever Network Time Protocol (NTP) pool the operating system was  setup with (in particular if it included timezone ofssets) at the time that the file was created.

 

In addition, but more rare, that same information is affected in the XML schema depending on which programming language is used to interface computer systems with  a particular database that was designed to provide time stamps with time zones offsets.

 

Luckily, if what you're looking for is consistency with how the file creation dates and modified dates metadata are displayed accross all computer systems in your organization, the NTP can be adjusted manually and even customized with a different time-zone independent pool service.

 

The same is true if you just switch off "Set Time Zone Automatically" on a Micrososft Windows computer via "Adjust date/time" settings.

 

I am posting slides below to show how that information looks when my computer is set to adjust time zone automatically and when is off:

 

NOTE IN MY EXAMPLE THAT THE FILE IS OLD SO THERE IS NOT MUCH THAT I CAN DO TO CHANGE THAT CREATION DATE BECAUSE IT USED A DIFFERENT DATE/TIME WITH A TIME ZONE SERVICE THAT WAS SET AUTOMATICALLY IN THE COMPUTER THAT THIS EXAMPLE FILE  WAS CREATED.

 

BUT LOOK AT THE TIME DISCREPANCY IN THE FILE CREATION DATE AND MODIFIED DATE PORTIONS.

 

xmpdata.png

 

 

 

If I understood correctly, you want to see consistency between the metadata that is displayed by the operating system and the metadata that is displayed through the Acrobat program Porperties.

 

 

xmpdata2.png

 

 

NOTE IN THE SLIDE BELOW HOW THE MODIFIED DATE PORTION REMAINS CONSISTENT IN BOTH THE METADATA OBTAINED THROUGH THE WINDOWS FILE EXPLORER PROPERTIES FOR THE SAME FILE THAT I HAVE OPENED SIDE-BY-SIDE WITH  ACROBAT  (THE XML SCHEMA SHOWS THE SAME HOURS AND MINUTES REGARDLESS OF THE TIME ZONE OFFSET)

 

THERE IS NO DISCREPANCIES IN THE HOURS AND MINUTES AFTER SWITCHING OFF THAT SETTING ON WINDOWS

 

xmpdata4.png

 

So, you may want to be aware of how this particular Windows time and date setting affects the file creation date and the modified date.

 

Below are some links of interest that helped me figure out my findings:

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 07, 2022 Nov 07, 2022

Copy link to clipboard

Copied

I don't doubt that complicated things are happening. But you are assuming that Acrobat is responsible, that Adobe's programmers have made decisions about time zones, daylight savings and so on. I think your assumption is unlikely.

 

Formatting dates is complicated. Adobe chose not to just reproduce the XMP date format 2011-09-27T11:01:11-04:00. Not very user friendly. But Adobe just convert this date to UTC, and pass it to code that is part of the system saying "format the date". So, these decisions are being made, but they aren't being made by Acrobat, and aren't being made by Adobe. They may or may not use your system preferences about language, words in months, 24 or 12 hour clock etc. etc. It might change the order of the numbers. Conceivably it is even converted to a different calendar. Windows supports these calendars: Arabic, English, Hebrew, Hindi, Chinese, Japanese, Korean, and Thai. Nobody wants to reinvent this wheel.

 

The question of whether a past/future date should be shown respecting daylight savings is a complicated one. It can be confusing to see two times 0900 that are 23 or 25 hours apart. But equally, the "airline timetable" rule is important; when booking a future event the expectation is that the time shown will be the local time that applies on the day.  Anyway, we can't answer your question, but I suggest you look at what system date formatters do. We cannot know that Acrobat uses them: we can't look at Adobe's code.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 07, 2022 Nov 07, 2022

Copy link to clipboard

Copied

I hear what you're saying... I can accept that this is possible. Also, your previous reply (that the system may be doing something) makes more sense now. 

 

But on the one hand, it was possible Acrobat devs might know more about this, and point out something Acrobat was doing, that I didn't realize. (Or maybe I was just missing something about time zones.) So I asked.

 

And on the other hand, I still don't see how Acrobat itself is showing me two different times, side by side, in its own displays, for that one PDF. As an extension to your potential thought, maybe one of them is going through more system "processing" than the other, right? (But then, how can I know which one is "right"?) 

 

All in all, it's a real mystery. All I want to do is show a user of the little PDF management app I'm making, what the metadata says its Create and Modify date is. (This is managing a little library of ~800 PDFs we have; it's not actually editing the PDFs at all. Except to read the metadata. It's just a place to keep our PDFs organized.)

 

How can I show them the "correct" Create and Modify times if we extract the XMP values, but want to show users what they'd see if they brought up Properties for a PDF? See my dilemma? I don't know why it's doing what it's doing... or when it would do it. 

 

I've already spent a whole morning on this rabbit hole of "why are these timestamps from the same PDF different?" Now I may have to study this a lot further; maybe assess the ~800 PDFs to see when their timestamps do or don't differ from each other. By an hour, or whatever it is. Is it during DST periods, or not? Etc. All this just to try to figure out what's going on. So that we might properly display the 'right' timestamp in the app, if a user brings up a PDF's Properties.

 

Why is everything always so much more complicated than one thought, lol. At the start of this morning's work I was already way behind. Now, with this time difference, I have found yet another thing to potentially make this little PDF management app many many more hours behind, ha ha.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines