Alert.png The wiki is deprecated and due to be decommissioned by the end of September 2022.
The content is being migrated to other supports, new updates will be ignored and lost.
If needed you can get in touch with EGI SDIS team using operations @ egi.eu.

Difference between revisions of "APEL/TimeZones"

From EGIWiki
Jump to navigation Jump to search
(Created page with "= Time Zones and APEL = APEL works in UTC, which is both simple and convenient (because we happen to be in the UK). == Epoch Times == Epoch times are also convenient, because ...")
 
Line 24: Line 24:
* The P denotes 'period' and must be at the start of the string.
* The P denotes 'period' and must be at the start of the string.
* Y, M, W, D, H, M, S stand for year, month, week, day, hour, minute and second respectively.
* Y, M, W, D, H, M, S stand for year, month, week, day, hour, minute and second respectively.
* T (for time) sits between date values and time values so that you can distinguish months from minutes.  So <code>P1M</code> or <code>P1MT</code> is one month, but <code>PT1M</code> is one minute.
* All durations are optional and you can use any combination you choose.
* All durations are optional and you can use any combination you choose.
* Our calculations of month and year are approximate, so if you want to be exact use days, hours, minutes and seconds, eg <code>P235D14H7M12S</code>.  This is the same as <code>P21010032S</code>.
* Our calculations of month and year are approximate, so if you want to be exact use days, hours, minutes and seconds, eg <code>P235DT14H7M12S</code>.  This is the same as <code>P21010032S</code>.

Revision as of 16:05, 4 April 2012

Time Zones and APEL

APEL works in UTC, which is both simple and convenient (because we happen to be in the UK).

Epoch Times

Epoch times are also convenient, because they are all in UTC and you don't have to convert. This means that whenever we get a message, we can rely on the timezone being correct and the conversion being automatic. In many of the batch system log files, the dates are in epoch times, presumably for the same reason.

ISO 8601

The CAR uses ISO 8601 dates and time durations. This presents a little bit more difficulty.

ISO 8601 Dates

The ISO 8601 dates are quite permissive, so there are a lot of possibilities. I'm using python-dateutil to parse them, which should work fine.

There is one caveat - if there is no time zone information provided in the date, I'm assuming that the date and time are in UTC - there's not much else I can do.

ISO 8601 Durations

These aren't that widely used, so there aren't standard libraries to parse them.

We are accepting durations of the form: P1Y2M3W4DT5H6M7S

  • The P denotes 'period' and must be at the start of the string.
  • Y, M, W, D, H, M, S stand for year, month, week, day, hour, minute and second respectively.
  • T (for time) sits between date values and time values so that you can distinguish months from minutes. So P1M or P1MT is one month, but PT1M is one minute.
  • All durations are optional and you can use any combination you choose.
  • Our calculations of month and year are approximate, so if you want to be exact use days, hours, minutes and seconds, eg P235DT14H7M12S. This is the same as P21010032S.