J
Jim Davis
I'm (still) working on an ISO 8601 date parser. I want to convert at least
the formats described here:
http://www.w3.org/TR/NOTE-datetime
Well.. I've got most of it working (via RegEx's) good enough for me but I'm
having a brain block when it comes to TimeZone.
The datetime may come with an optional timezone offset (from GMT) as here
(the offset is +1 hour from GMT):
1997-07-16T19:20:30+01:00
So... that's the current time there... but my spec is that timezone
information, if present, should be used to convert the given time to local
time. For me, for example, this would be -5:00 from GMT.
I've already split the Timezone information: I've got indiviual access to
the sign (plus or minus), the hour offset and the minute offset.
So I'm sure there's a nice, simple formula for this... but it eludes me. Or
I'm lazy... I can't decide which.
Any pointers?
Thanks in advance,
Jim Davis
the formats described here:
http://www.w3.org/TR/NOTE-datetime
Well.. I've got most of it working (via RegEx's) good enough for me but I'm
having a brain block when it comes to TimeZone.
The datetime may come with an optional timezone offset (from GMT) as here
(the offset is +1 hour from GMT):
1997-07-16T19:20:30+01:00
So... that's the current time there... but my spec is that timezone
information, if present, should be used to convert the given time to local
time. For me, for example, this would be -5:00 from GMT.
I've already split the Timezone information: I've got indiviual access to
the sign (plus or minus), the hour offset and the minute offset.
So I'm sure there's a nice, simple formula for this... but it eludes me. Or
I'm lazy... I can't decide which.
Any pointers?
Thanks in advance,
Jim Davis