Issue 0047

Summary
convert timestamps in Fuego to be RFC 3339-compliant
Owner
Tim
Reporter
Tim
Status
open
Priority
medium

Description [edit section]

Timestamps in Fuego version 1.1 use a time format that is close to iso8601-compliant, but not exactly. Specifically, is uses the following shell command expansion to set the value of BUILD_TIMESTAMP

export BUILD_TIMESTAMP=$(date +%Y-%m-%d_%H-%M-%S)

This uses underscore as the delimiter between date and time (where ISO860-1 uses 'T'), and dashes between time elements (instead of colons).

ftc (version pre-1.2) currently uses:

timestamp = time.strftime("%Y-%m-^d_%H-%M-%S")

We should add an indicator of timezone.

Is this really needed? I think it's only needed if we need to order or compare build start times between sites. I'm not sure yet if this is needed.

See https://tools.ietf.org/html/rfc3339

We should definitely use colons in the time portion of the timestamp.

Here is the RCF3339 spec:

Note the last line, which allows a space character to replace "T", but allows for a different character for readability.

In order to use timestamps as part of file and directory names, and avoid problems with file and directory names containing spaces, Fuego chooses to use an underscore to replace the 'T' in the iso8601 specification, as the delimiter between the date and time portions of the timestamp.

Notes [edit section]

Note that date can output in rfc3339 format, with $(date --rfc-3339=seconds)

Executing this in San Jose (UTC-7), gives:

However, this uses a space in between the date and time, instead of a 'T'.

the 'date' command on Ubuntu 14.04 supports the '%:z' option, which shows timezone information in [-+]hour:minute format. However, strftime and python's time.strftime() does not support the %:z option.

They only allow %z, which shows the timezone offset as a single 4-digit number: e.g. '-0700'

The posix page for strftime does not support the '%:z' options. http://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html

And strptime doesn't support either %:z or even %z, so apparently can't parse the timezone information at all. see 'man strptime'.

Various python lists have bug reports about the difficulty of parsing RFC3339-format timestamp strings, due to the issue of the colon in the timestamp.

Maybe I should use "%F_%T%z" as the format string instead?

How to change timezone in Jenkins [edit section]

https://stackoverflow.com/questions/42202070/how-to-change-the-time-zone-in-jenkins

Modify /etc/timezone with your timezone information.

Do a systemwide export of TZ, in /etc/profile

backlink

Fuego Issues List