Ask Your Question
0

Parse Catalog Timestamp PE 2015.3.1

asked 2016-01-25 04:14:44 -0500

FranzCC gravatar image

Hi, i'm trying to parse the output of catalog_timestamp but failing because of the last 3 positions after the seconds.
As of ISO standard, the "Z" means to abbreviate the local timezone.
E.g.: puppet outputs:

2016-01-25T10:11:44.129Z

I would use the date command:

 date  '+%Y-%m-%dT%H:%M.%S%z'

Which outputs:

2016-01-25T11:12.18+0100

What are the 3 digits in my example output ? (129)

Please name the corresponding ISO date string.
IMHO the puppet output doesn't correspond to any ISO standard.

Thanks in advance

Franz

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-01-25 19:42:18 -0500

GregLarkin gravatar image

The date that Puppet displays appears to conform to http://www.ietf.org/rfc/rfc3339.txt. Specifically, these sections:

Found in "Definitions":

  Z           A suffix which, when applied to a time, denotes a UTC
              offset of 00:00; often spoken "Zulu" from the ICAO
              phonetic alphabet representation of the letter "Z".

Then found in the examples:

5.8. Examples

Here are some examples of Internet
date/time format.

      1985-04-12T23:20:50.52Z

This represents 20 minutes and 50.52 seconds after the 23rd hour of    
April 12th, 1985 in UTC.

The ".129" in your sample output appears to represent fractions of a second. I don't see a way to output that exact string format using the date command, though.

This page (http://unix.stackexchange.com/questions/120484/what-is-a-standard-command-for-printing-a-date-in-rfc-3339-format) doesn't seem to help much either.

edit flag offensive delete link more
0

answered 2016-01-26 01:15:23 -0500

FranzCC gravatar image

Hi Greg,
thanks for the answer
If 129 is a fraction, then it could be a hires timer added for the fraction of a second.
Seemingly no standard but not a big problem.
I will parse only seconds and leave the fraction out

Rgds.

Franz

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-01-25 04:14:44 -0500

Seen: 62 times

Last updated: Jan 26 '16