本文转自:
You would be better off setting the time zone ahead of time:
SET time_zone='UTC';select FROM_UNIXTIME(1277942400);
SELECT CONVERT_TZ(FROM_UNIXTIME(1277942400), @@session.time_zone,'UTC') SELECT @@global.time_zone, @@session.time_zone; time_zone = '+00:00'
date_default_timezone_set("Asia/Shanghai");