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

Proper time/date stamp format?

Explorer ,
Mar 13, 2023 Mar 13, 2023

Copy link to clipboard

Copied

I produce PDFs using the PDF::Builder Perl library. It has come to my attention that my library validates as OK timestamps (Creation and Modification dates, etc.) that end with HH'mm, but not HH'mm'. Checking old (1.4, 1.7) Adobe PDF specs, it states that HH'mm' is the correct format; however, the 2008 ISO 32000-1 standard (as published by Adobe), as well as IBM, state that HH'mm is the correct format. Stack Overflow agrees that HH'mm is the ISO standard, although they observe that Adobe products regularly produce the HH'mm' format. No one had seen a Reader (e.g., Acrobat) that wouldn't accept both.

 

So, is there a preferred format? Has there been any statement that one way or the other will not be accepted in the future? Does anyone see any problem with accepting (validating) timestamps in both formats?

TOPICS
Create PDFs , Edit and convert PDFs , Standards and accessibility

Views

5.4K

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

correct answers 1 Correct answer

Community Expert , Mar 16, 2023 Mar 16, 2023

++ EDITES REPLY,  fixed more typos

 

You're welcome.

 

The topic fascinates me and I am learning as I go. So, please excuse me if you spot any discrepancies in my comments that  deviate from the topic.

 

In any case, my confusion is due to not understaing the context of user date insertion in a file.

 

All along I've been focused with Date Creation and Modification  from the moment a user digitally signs a PDF document with a certificate-based digital signature.

 

In which case, the validation p

...

Votes

Translate

Translate
Community Expert ,
Mar 13, 2023 Mar 13, 2023

Copy link to clipboard

Copied

Hi,

 

I believe that it is not a preferred format, but how the Acrobat JavaScript core interpreter handles the date/time notations.

 

While the JavaScript portions that are shipped with an operating system will interface with the system clock, web browsers and websites based on ISO date standards, the same is slightly different in Acrobat JavaScript.

 

For instance, using a time notation as HH'mm to express hours and minutes, in Acrobat JavaScript the uppercase "HH" is reserved to express hour notations. And  upper case "MM" to express minutes.

 

Using "HH:MM" denotes a 24-hour clock (or military time), while using lower case "h" (or "hh") with uppercase MM  (i.e. h:MM) denotes a 12-hour clock (am or pm).

 

In Acrobat JavaScript the lower case "m" is reserved to notate the month, not to express time in minutes.

 

If you are scripting, like for example, using the util.scand() and util.printd() methods, take care of the JavaScript portion in your script to reflect  "HH:MM" or "hh:MM" notations.

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
Explorer ,
Mar 13, 2023 Mar 13, 2023

Copy link to clipboard

Copied

Thanks, but Javascript is not involved here. The full spec (per ISO/IEC 8824 and the ISO/Adobe PDF spec) is

 

D:YYYYMMDDHHmmSSOHH'mm

 

where YYYY = year, MM = month 01-12, DD = day 01-31, HH = hour 00-23, mm = minute 00-59, and SS = second 00-59. O is +, -, or Z; HH is hours from UT, mm is minutes from UT. "D:" and " ' " are literally those.

 

The earlier Adobe PDF specs end with HH'mm'.

 

So, my question is whether it's important to use (or NOT use) the trailing '. Many Adobe products apparently use the trailing ', but most (if not all) readers seem to be happy supporting either format. When validating a user-specified time/date stamp, would it be reasonable to allow either way (trailing ' or not)? If my library needs to generate a time/date stamp, is one format or the other preferred?

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 ,
Mar 13, 2023 Mar 13, 2023

Copy link to clipboard

Copied

I apologize, I misunderstood your requirement completely.

 

Because I don't know how to script in Pearl, I can't see exactly which part(s) would integrate with Adobe Acrobat as the host program except for when the final PDF is actually opened in Adobe Acrobat.

 

I would say that the ISO's alone does not entirely dictate a matter of agreement among different entities.

 

In fact, I think that your very valid inquiry gravitates more towards how the application and usage of the validating process will interact with the system clock (i.e. if it is a Zulu timezone (Z) or a UTC zone with offset, specifically if it observes Daylight Saving Time as defined in: https://www.rfc-editor.org/rfc/rfc3339  and complemented with: https://www.rfc-editor.org/rfc/rfc5544 ).

 

In which case, if the validation that you need would be required for digital signatures as defined in: https://www.rfc-editor.org/rfc/rfc3161 for PKI Time-Stamp Protocol,  you'll notice that whatever validating mechanism provided in Acrobat (Edit => Preferences => Signatures => Verification) takes the date/time from the users computers system clocks at signiing time (or from whatever time-stamp server is configured internally within an organization to assign the signers PKI time-stamps).

 

So, if that is what you were inquiring about, such validating time-stampverification is basically defined when a PDF document is finally opened and viewed in Adobe Acrobat Pro.

 

As far as I was able to test before replying back to you, the time stamp validation looks like this when I change my date/time settings to an UTC zone:

 

sigTest.png

 

While selecting Universal Coordinated Time zone will obviously display automatically the Zulu identifier (Z) instead of an 00'00' offset, shown below:

 

signTest2.png

 

Not sure if this is helpful, but I hope it may be relevant to answer your inquiry and point you in the right direction.

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
Explorer ,
Mar 14, 2023 Mar 14, 2023

Copy link to clipboard

Copied

Sorry if I wasn't totally clear in my initial post. From the Adobe/ISO 32000-1:2008 PDF reference, the pertinent information is

 

" The prefix D: shall be present, the year field (YYYY) shall be present and all other fields may be present but only if all of their preceding fields are also present. The APOSTROPHE following the hour offset field (HH) shall only be present if the HH field is present. The minute offset field (mm) shall only be present if the APOSTROPHE following the hour offset field (HH) is present. The default values for MM and DD shall be both 01; all other numerical fields shall default to zero values. A PLUS SIGN as the value of the O field signifies that local time is later than UT, a HYPHEN-MINUS signifies that local time is earlier than UT, and the LATIN CAPITAL LETTER Z signifies that local time is equal to UT. If no UT information is specified, the relationship of the specified time to UT shall be considered to be GMT. Regardless of whether the time zone is specified, the rest of the date shall be specified in local time.

 

" EXAMPLE   For example, December 23, 1998, at 7:52 PM, U.S. Pacific Standard Time, is represented by the string D:199812231952-08'00

 

D:YYYY is the minimum allowed; all else is optional, with specified default values. In the above example, it sounds like the trailing 00 or even '00 could be omitted, if desired. I notice that the seconds field was dropped -- this suggests that the date-time and timezone segments are treated separately (?).

 

Acrobat (or other Adobe products) are not necessarily involved here in the production or editing of a PDF file, but obviously it would be good for such PDF files to be fully interoperable with Adobe products for display and/or editing (or even, creation in the first place). Thus, my question about which (or both) standards should be supported for the format of a time/date stamp placed in a PDF.

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 ,
Mar 16, 2023 Mar 16, 2023

Copy link to clipboard

Copied

++EDITED REPLY, fixed many typos and rephrased some lines to clarify explanations

 

Hi,

 

You're good, you were very clear from the get go, I wasn't clear because I was reading too fast. But your last reply helped me to get focused on gathering the right answer.

 

To re-verify,  if I understood you correctly, the answer to which standard should be used is a matter of clarity based off of ISO 8601 best practices and principles.

 

The fact that you asked while using the Adobe/ISO 32000-1:2008 PDF as a reference makes me wonder why is that not fully addressed in that document.

 

Not only the numerical date/time notations weigh almost exclusively on clarity, but it also matters in a legal context ( as explained here: https://www.jonathanhak.com/2018/01/27/date-and-time-stamp-authenticity/), to include financial business transactions, International communications, aviation, military, etc...

 

Which numerical notation should be employed as the most convenient method, well, you should go with whatever you believe is more important in your work environment.

 

If it was up to me, I would consider how my PDF users will understandand and interpret a numerical date/time stamp notation as they work with documents with other computer programs.

 

It should also matter to a PDF user a how a different representation of the same date/time is notated accross different document types(other than a PDFs) and depending on how such documents are validated against  the date/time stamp that is enforced in their machines .

 

In other words, it is relevant to me to keep an eye on the local date/time stamp that is taken automatically from the system clock.

 

Assuming that such date/time is always configured correctly in those personal computers, it should also matter how is that data synchronized via Network Time Protocol (NTP) servers to capture the DST offset difference from UT without errors.

 

That said, it also comes to play the date/time that is also used with their personal mobile devices, in Email communications, or the web sites that are interfaced by means of web browsers, for example.

 

All of which may express date/time validation notations with similar ISO standards but differently.

 

Because so many things are involved (or could be involved in your workflow), the whole point of standardization is to provide error-free and accurate validation.

 

But ultimately it is you, as the developer of that workflow,  who defines which standard should be employed (or prefereed over other accepted variants of the same standards) amongst all of your workers in your organization and all of your business partners in order to conduct business effectively with others.

 

To backup my answer see these next two links:

 

 

In addition, you also mentioned :

 

  • If no UT information is specified, the relationship of the specified time to UT shall be considered to be GMT. Regardless of whether the time zone is specified, the rest of the date shall be specified in local time

 

In the past, GMT used to be employed as a time standard.

 

Nowadays it is used as a Timezone Designator and it can be used interchangeably with UTC (winter time (or standard time) or summer time (Daylight Saving Time (DST)) timezone designators with offsets.

 

The only thing that differs between GMT and UTC timezone designators is that the  NTP servers need to be calibrated every certain amount of years by a few seconds to keep track of a difference in extra seconds and match that of the GMT local time appropriately.

 

See slide:

 

Screenshot_20230316_003657_Epic.png

 

 

 

  • D:YYYY is the minimum allowed; all else is optional, with specified default values.

 

Yes, the 4 digit date is the minimum and the main reason is for clarity in regards of inter-communications with different countries other than the US.

 

In your case, this is very relevant to know because in the US short date expressions such as "02/13/23" creates confusion for people who live in geographical regions outside of North America (where the month is before the day,  and the day, the month, and the year expressions consist of a two digit mumerical notation).

 

In other words, if I was born and raised in France, or better yet, somewhere in an Asian country, I would be struggling figuring out what comes first:  the day?  the month? or the year?

 

I would also have  a hard time trying to understand the context of the century and the millenia just by looking at the date stamp.

 

Specially if such document would be referring to a date in the 1900's (or any time before and outside of that era).

 

Some of this  is outlined and explained in the ionos.com website that I posted for you above (first bullet link).

 

The same applies for a time stamp to represent hours (HH), minutes (MM), seconds (SS),  and it can use delimeters such as colon ":", period ".", or dashes "-"  which are all accepeted per ISO standards.

 

The usage of such delimeters is not necessarily relevant to express numerical notations of the Timezone offset.

 

Both of the apostrophe or the colon symbol may be used with the offset notation.

 

It aids the user with visual clairty and highlights  the hours from the minutes segments (specially when a time-stamp with offset is very small to read for someone who is conducting electronic  records compliance audits).

 

NOTE:

The two digit minutes segment is not really needed with the offset notation.

 

In my case at work, for example, I  frequently process many  government PDF forms that require certificate-based digital signatures. They all need validation with a date/time stamp with offset.

 

The PKI time-stamp protocol requires that a timezone offset is included at the end of that notation.

 

Such offset notation is based off of  the DST,  provided that the computer's system clock date and time stamp is configured correctly and also how it correlates to  UT as captured by the NTP servers at validation time.

 

Anyhow, this validation date/time stamps with offset are always printed out very small making it very hard to read (but extremely  easy to make mistakes).

 

So,  an offset notation that is trailed after the time stamp segment,  like 02:34:56 +08'00', it makes perfect visual clarity to me as opposed to stamping the same line as  02:00:34 +08:00.

 

  • In the above example, it sounds like the trailing 00 or even '00 could be omitted, if desired. I notice that the seconds field was dropped -- this suggests that the date-time and timezone segments are treated separately (?)

 

Yes, it can be ommited. See my Note above.

 

In fact, it is very common nowadays to see in airports or commercial websites that include at the end of their hours of operations notation "(UTC -8)" or "(GMT +1)", for example.

 

This is convenient for travelers or when a person needs to arrange for a business meeting over videochat or phone call.

 

In which case, a notation like UTC -8 tells me that this is a geographical region that observes DST and falls in a longitude to the West of UT; in which case, I should consider adding 8 hours to my local time prior to the meeting (if everyone that I am communicating with is using a 12-hour clock) .

 

While UTC +1 tells me that this is a geographical region that observes DST and falls in a longitude to the East of UT; and  I should substract one hour from my local time (if everyone that I am communicating with is using a 12-hour clock).

 

It gets tricky when using  a code implementation with the 24-hour clock ISO standard to convert time to or from a 12-hour clock and get the correct timezone offset.

 

In a 24-hour clock,  time starts at 00:00 (zero hundred hours) to express midnight (or 12am if using a 12-hour clock),  and up to 23:00 (twenty-three hundred hours) to express  11pm if using a 12-hour clock.

 

 I've also seen offset notations expressed as " -800" or "+100",  or when conversion charts are used, just "-8" or "+1" is employed.

 

Anyway, interestingly enough, the total longitudes are also 24, thus the 24 hours that are accounted for in a 24-hour clock.

 

Those 24 longitudes include International date time zones [ starting at 0 degree longitude at UT with 11 longitudes (or timezones) that span to the West of UT, and 12 longitudes (or timezones) to the East of UT ].

 

That also includes the Â±180 degree longitude (or UTC Â±12:00 if I am not mistaken), which falls within the International dateline  boundary at all times].

 

Every longitude is exactly 15 degrees apart, which is basically an hour (or more specific, 60 minutes).

 

And as the Earth rotates, the Sun is observed at its highest point at 12 noon at UT (or so humanity was taught) since the inception and full acceptance of the Gregorian Calendar over the Julian Calendar to account for rollover dates, extra hours (or days), and leap years as DST  occurs daily in relation to UT all year around.

 

 

NOTE:

 

It would be very interesting to see how a flat-earther would explain all of this this stuff without involving the Christian Bible or the Quran as references...

 

Not that I am not open to the concept of a flat-earth but LMAO!!!   xD   just think about it for a moment.

 

Hell! there are geographical regions in our world that observe up to three or more DST changes in a single day... 

 

How to factor that in accurately per ISO, and expect to get no errors when  a script executes a validation ?!?!?

 

NOTE ENDS

 

 

 

But again,  for a date/time stamp, you should stick with whatever the ISOs permit within the accepted universal conventions.

 

And ultimately, it is you who decides what to ommit or what to define to represent the numerical notation of the offset value with a delimited notation.

 

That explains why the seconds segment can be dropped and also why (for the sake of the easiest way to express this with computer programming) it is treated separately from the date/time segments.

 

The point is that it is really a matter of choice if you want to separate hours from seconds with the offset numerical notation by way of using the colon symbol as delimeter or the apostrophe.

 

Things get a lot trickier  if you were using DateTimeGroup (DTG), like in the military.

 

And even trickiest if you had to plot a gridzone with decimal degrees or nautical degrees combines with a DTG notation.

 

In which case, when nautical degrees are used, the hours, minutes and seconds are delimited using the following notation:

 

  • 90° 12' 45654" S.

 

Notice that an offset is not needed because this expression  by itslef is just a latitude  somewhere in the World and it is not accompanied by a date/time group.

 

If I am not wrong, 90° is the degree hours, 12' is the minutes, and 45654" the seconds for tgat latitude.

 

The letter "S" is used to represent a southern latitude (or using the minus ("-") symbol indicates that a latitude is to the  South of the Ecuator line).

 

For the longitude a notaion like  123° 12' 23423" E would be used.

 

The letter "E" indicates an Easting longitude  (or  using the ("+") symbol indicates that a longitude is to the East of UT). 

 

If that wasn't enough to cope with, that gridzone degree notation is preceeded by a DTG alpha-numerical notation like:

 

  • "031238NOV2023G"

 

Where "03" is the day of the month, "1238" is the time in hours and minutes altogether (no ":" delimiter is used with military time), the month is abbreviated with 3 character letters (not a numerical notation).

 

It is followed by the four digit numerical year notation (YYYY) standard,  and lastly,  a single character letter to indicate the timezone (or offset),  which ranges from A to I, and K to Z.

 

Letter J is omitted as a timezone designator.

 

I am mentioning about the DTG standard convention in contrast with other date/time notation standards, because the date/time grouo with offset segment must be explicitely expressed in that format. 

 

The user who writes a date/time in DTG does not enjoy the same optional liberties that you have with your current project.

 

 

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
Explorer ,
Mar 16, 2023 Mar 16, 2023

Copy link to clipboard

Copied

It sounds like there may still be some confusion on one of our parts (or maybe both!). What I'm concerned with here is only the format of a user-supplied timestamp for insertion into the PDF file for Creation or Modification date. I am validating it to make sure it's the right format (and plausible content), and I raised this issue because of conflicting definitions among the various PDF references. 2008 was a while ago, and it's even possible that those definitions have been superseded. Even the example given in the Adobe docs doesn't seem to quite match the words (i.e., omitting seconds). I just want to make sure whatever date/timestamp I allow to pass into a PDF file will be acceptable to the vast majority of editors and Readers.

 

> The two digit minutes segment is not really needed with the offset notation.

 

Um, I have seen time zones with 30 minute or even 15 minute offsets compared to their neighbors, so I think it's necessary to support minutes of offset. I have no idea what to do with primitive places that use local solar time!

 

In the future, I may end up assembling a date/timestamp from the system clock and/or other data, so I'd like to be sure of the format. Lots of information in your post (thank you!); maybe I'll get to make use of much of it soon.

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 ,
Mar 16, 2023 Mar 16, 2023

Copy link to clipboard

Copied

LATEST

++ EDITES REPLY,  fixed more typos

 

You're welcome.

 

The topic fascinates me and I am learning as I go. So, please excuse me if you spot any discrepancies in my comments that  deviate from the topic.

 

In any case, my confusion is due to not understaing the context of user date insertion in a file.

 

All along I've been focused with Date Creation and Modification  from the moment a user digitally signs a PDF document with a certificate-based digital signature.

 

In which case, the validation process is very straight forward, and the date creation and appearance is defined with the SDK guides, like the Acrobat Digital Signature Workflow Guide.

 

If you are referring to validating the final result of other actions that a user may employ with Acrobat, such as approving a document with dynamic stamps or custom made annotations,  capturing the date/time when a document is sent/received via email, sharing a file for comments/review,  batch stamping PDF file names with a date/time stamp, exporting/importing date/time stamped documents between Microsoft Office and Acrobat,  combining PDFs files or binding PDFs, or indexing catalogs in a computer system to search and file PDFs that may contain a date/time stamp as a file name, that is the part that I am not clear.

 

As for the issues that you are concerned with:

 

  • conflicting definitions among the various PDF references. 2008 was a while ago, and it's even possible that those definitions have been superseded.

 

The PDF references are not enough to cover all aspects.

 

From what I've read Adobe transferred to ISO.org the managing of the reviewing process.

 

The reviews on these ISO versions are done every 5 years.

 

The last review on Adobe ISO 32000-1:2008 version 1.7 was done back in 2018 to reflect changes with newer features that has been added to Acrobat.

 

  • Even the example given in the Adobe docs doesn't seem to quite match the words (i.e., omitting seconds)

 

It won't match because Adobe/ISO 32000-1:2008 is too ample and doesn't focus on how to handle the  date/time stamps granularity, comparing dates with different precission, nor how to address the aspects of notating an ambiguous   UTC offset with hours, minutes and seconds.

 

That ambiguity is due to many countries that observe DST based on legal or political reasons, and therefore, those countries that define theirbown DST can  change it without notice.

 

To work around that ambiguity, and  how the offset should be notated, is referenced (or complemented) with other guides outside of the generic scope defined in the ISOs.

 

Most recent changes are addressed through normative references and errata references.

 

ISO 8601 is the most flexible documentation in terms of how to use date/time formats guidelines, and it is widely used nowadays to define date/time creation stamps.

 

That being the case, you should reference your workflow based of ISO 8601 standard since it does allows the omission of elements (i.e. dropping the minutes and seconds segments in an offset notation), with many different date/time stamp formats.

 

However, how to work around date/time formats when comparing two or more dates with different precission, and how to define offset granularity in a human-readable form (like adding or dropping  the seconds segment to the offset notation), the ISO standards ( both  Adobe/ISO 32000-1:2008 amd ISO 8601) should be referenced further with a date/time stamp profile.

 

See in the link below what to consider with specific profiles (described in pages 4-9) of the RFC 3339 below:

 

 

Also check out this 3WC link:

 

 

Read the section FORMAT to the end of the document.

 

It provides a profile that defines two ways of handling the timezone offsets ambiguity.

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