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.  I know this should be
simple... or maybe I'm simple... but I can't get my mind around it
correctly.

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?

(I'm actually currently writing this in JavaScript... but I've got to do a
CF version next so it's sorta on topic.  ;^)  )

Thanks in advance,

Jim Davis




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:216780
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to