3

Is it possible to determine from looking at datetime value whether it is local time or GMT with the offset? I have no idea about this and pretty embarrassed to say it out loud.

<time>2012-11-07T15:22:31Z</time>

Now I need to show this time in GMT with its offset for local time. Am I just to assume that his is local time and what is the Z & T for>

EDIT

Thanks for the links. So what would the following be

2012-11-09T12:34:02+00:00

is that the offset for UTC

vbNewbie
  • 3,291
  • 15
  • 71
  • 155
  • Do you write the code which generataes that time stamp? – Emmanuel N Nov 09 '12 at 16:02
  • Check this out, Should not be any different in VB. http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html – sathish_at_madison Nov 09 '12 at 16:03
  • Here is an answer for VB: http://stackoverflow.com/questions/7265092/how-to-convert-utc-datetime-column-to-local-time-in-datagridview (BTW: It is UTC time with the Z on it) - More info here: http://www.hackcraft.net/web/datetime/ – JohnFx Nov 09 '12 at 16:04
  • no I dont I parse that time out of an xml feed....I do create another time stamp for when I do this and it is in this format 2012-11-07 15:22:00 using parsedate.ToUniversalTime.ToString("yyyy-MM-dd HH:mm:ss") – vbNewbie Nov 09 '12 at 16:06

1 Answers1

2

That is time presentation in ISO 8601.

T is is the time designator that precedes the time components of the representation.

and

Z is the second designator that follows the value for the number of seconds.

To convert ISO 8601 to to local or UTC write a custom converter like this one

Community
  • 1
  • 1
Emmanuel N
  • 7,350
  • 2
  • 26
  • 36