. Sometimes you find it impossible to change the time setting up a Web Server or MySQL to work on a table where a field TIMESTAMP is set to ON UPDATE CURRENT_TIMESTAMP . So it becomes necessary, in the face of a select, adjust the time retrieved with the correct time zone. For example, if our server is located in Los Angeles, with a time zone 9 hours back, simply use:
1 2 | campo_timestamp , INTERVAL 9 HOUR ) AS `local_timestamp` SELECT DATE_ADD (campo_timestamp, INTERVAL HOUR 9) `AS` local_timestamp FROM mytable |
è la stessa data 9 ore avanti. The field campo_timestamp contains the actual date of the server and the alias local_timestamp is the same on 9 hours ahead.










There are no comments for this post
Leave a comment