What the Minus Sign Does in xs:dateTime

Have you ever seen some XML like the following and wondered what that “-08:00″ was for?

<gd:when startTime="2005-06-06T17:00:00-08:00"/>

Well after much searching it turns out that it specifies the time zone offset from Greenwich Mean Time. Otherwise the app accepting your XML might assume you meant Greenwich Mean Time and put your Tea time at some weird hour!


This guy’s slides explain the xs:dateTime format a bit:

xs:dateTime – an ISO 8601 date plus a time.
The date is separated from the time by a ‘T’: 2005-03-10T02:00:00-08:00
The time format is ‘hh:mm:ss’ with at optional fractional seconds and optional timezone offset.
The timezone is Greenwich Mean Time unless you specify the offset.

And by the way, if you want to find out what your UTC time zone offset is, you can look it up here.

And here are my myriad of search terms:

  1. python datetime to xs:dateTime
  2. “time zone offset”
  3. how to find my time zone offset
  4. “xs:dateTime” + minus + mean
  5. What does -08:00 Mean in xs:dateTime
  6. “xs:dateTime” + timezone, xs:dateTime

[tags]xs:dateTime, time zone, xml, schema, ISO 8601[/tags]

Comments are closed.