Ahh. And we have customers all over the world. Dang. See, all of this
programming was done back shortly after we "sprang forward" so we didn't
think about it.
Any suggestions on how I should store a customers timezone in database?
Thanks,
Matthew
Dave Rolsky wrote:
On Thu, 2 Nov 2006, Matthew wrote:
I tried to do so. The problem is that the date's are stored in the
users local timezone and we only store the offset from GMT. (ex: -6 or 7)
Well, there's your problem right there. You realy can't do this and
expect it to work, as you're finding out. You need to store the user's
timezone, not their current offset. If you know all your users are in
the US you might be able to come up with some hacks to deal with DST,
but otherwise you really need to let DT::TimeZone do this for you (or
MySQL, or something).
Is there some array or table I can use to convert '-6' to something
DateTime:: can use?
No, there's no way to go from offset to time zone. Again, if your users
are all in the US, _and_ no one's in a "weird" zone (like Indiana, parts
of Arizona, etc) then you can probably convert it back.
-dave
/*===================================================
VegGuide.Org www.BookIRead.com
Your guide to all that's veg. My book blog
===================================================*/