> That's what I assumed... but I thought there must be some clever math to do > it without the interim conversion...
If you know your offset and the offset from UTC, you can add them together and do one timezone shift. For example, if the date is at UTC+1, and you're at UTC-5, then you need to do a shift of -6 to move the date to your local timezone. However, I'd say that'll be more confusing when you have to revisit the code in a few months. Going to UTC first, and then to local will be more obvious, since you can do the string to UTC conversion in the parser, and then do the UTC to local conversion when in your application code, based on the appropriate local offset. cheers, barneyb On 8/30/05, Jim Davis <[EMAIL PROTECTED]> wrote: > > -----Original Message----- > > From: Paul Hastings [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, August 30, 2005 2:12 PM > > To: CF-Talk > > Subject: Re: Timezone conversion > > > > Jim Davis wrote: > > > I'm (still) working on an ISO 8601 date parser. I want to convert at > > least > > > the formats described here: > > > > well there are a handful or two of java ones (from nasa, w3c, & the > > supreme overkill of joda-time) & i vaguely recall a function on cflib > > that does this. > > For the moment this is being done in JavaScript - but the same code will be > converted to CF afterwards. > > > > Any pointers? > > > > move that date to UTC (dateAdd its offset *-1.00 watching out that > > dateAdd function accepts integers), then to your timezone (dateAdd your > > tz offset to that UTC date). this might be of interest: > > That's what I assumed... but I thought there must be some clever math to do > it without the interim conversion... > > Ah well... that'll work. It's just not very elegant. > > Jim Davis > -- Barney Boisvert [EMAIL PROTECTED] 360.319.6145 http://www.barneyb.com/ Got Gmail? I have 100 invites. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:216834 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

