As I was having many nightmares because of the host I was using here in Brazil, I moved my website to a host in L.A., wich gives me 50 times more disk space and 30 times more traffic for the same fee (something hosts here in Brazil don´t even dream to offer, sadly).
Everything just like a fairy tale untill I asked Mr Server "Hey, man, What time is it?". The problem: Brazil is at GMT -3 and L.A. is in GMT -7, so I´ve got a little problem to solve about this virtual paradox, both in mysql and in Perl, as I have some cron routines that may generate bugs if I call them the wrong hour.
Can you point me something less dirty than doing it by hand, I mean, correcting every localtime(time) call? Also in mysql, I don´t know if I can set a separate timezone for my db through the .my.cnf file.
Thanks a lot
André
One possible solution would be to do everything in GMT instead of based on the local time zone. That way if you have to change hosts again in the future, you're not trying to convert -7 to +2. Also, LA does daylight saving time, so that in a month (or 2, they just changed it), they'll be in the -8 timezone.
Chad
The $offset would certainly work, the only issue I see is that it would have to be kept up manually. Moving hosts is rare, so probably not a large issue, but Daylight Saving Time will change the time zone twice a year, and DST in Brazil doesn't coincide with DST in LA. Depends on how important it is for this to be accurate.
Chad