On Thu, 2002-03-28 at 12:15, Paul DuBois wrote: > > >Description: > >After setting the TZ environment variable to a different timezone, then > >using the UNIX_TIMESTAMP(...) function on a mysql timestamp string > >brings back the correct time, but a date that is a day out, but only > >for certain dates. It seems that the date becomes the original date > >plus the difference in the timezones. Only the date is affected - > >not the time. Ie if the new timezone is +5 hours difference, then it > >will add 5 hours to the timestamp, use that date, then use the > >original time of the timestamp. > >Since a timestamp is a timestamp, it should not be affected by the > >timezone when displaying it. > > They're stored in GMT but converted to the server's timezone for display.
Sure, but why does the date change, and not the time? The conversion is muddling itself. > > >How-To-Repeat: > >1. create a timestamp in the database > >2. using a select statement, apply the UNIX_TIMESTAMP function to > >the timestamp > >3. change the TZ environment var to another timezone > >4. using a select statement, apply the UNIX_TIMESTAMP function to > >the timestamp > > > >repeat these steps for each of the 24 hours in the day for the > >original timestamp, and you will see that some of them will have > >different dates. > --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php