Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mysql> select now();
- +---------------------+
- | now() |
- +---------------------+
- | 2009-05-30 16:54:29 |
- +---------------------+
- 1 row in set (0.00 sec)
- mysql> select now();
- +---------------------+
- | now() |
- +---------------------+
- | 2009-05-30 20:01:43 |
- +---------------------+
- 1 row in set (0.00 sec)
- default-time-zone='+00:00'
- SELECT @@global.time_zone;
- SET GLOBAL time_zone = '+8:00';
- SET GLOBAL time_zone = 'Europe/Helsinki';
- SET @@global.time_zone = '+00:00';
- SELECT @@session.time_zone;
- SET time_zone = 'Europe/Helsinki';
- SET time_zone = "+00:00";
- SET @@session.time_zone = "+00:00";
- SELECT TIMEDIFF(NOW(), UTC_TIMESTAMP);
- SELECT UNIX_TIMESTAMP();
- SELECT UNIX_TIMESTAMP(NOW());
- SELECT UNIX_TIMESTAMP(`timestamp`) FROM `table_name`
- SELECT UNIX_TIMESTAMP(CONVERT_TZ(`utc_datetime`, '+00:00', @@session.time_zone)) FROM `table_name`
- SET time_zone = timezonename;
- $ sudo dpkg-reconfigure tzdata`
- `/etc/init.d/mysql restart`
- SET GLOBAL time_zone = '+8:00';
- value="jdbc:mysql://localhost:3306/dbname?serverTimezone=UTC"
- SELECT @@global.time_zone, @@session.time_zone;
- SET GLOBAL time_zone = "Asia/Calcutta";
- SET time_zone = "+05:30";
- SET @@session.time_zone = "+05:30";
- root@Ubuntu# ls -la /usr/share/zoneinfo/US
- total 8
- drwxr-xr-x 2 root root 4096 Apr 10 2013 .
- drwxr-xr-x 22 root root 4096 Apr 10 2013 ..
- lrwxrwxrwx 1 root root 18 Jul 8 22:33 Alaska -> ../SystemV/YST9YDT
- lrwxrwxrwx 1 root root 21 Jul 8 22:33 Aleutian -> ../posix/America/Adak
- lrwxrwxrwx 1 root root 15 Jul 8 22:33 Arizona -> ../SystemV/MST7
- lrwxrwxrwx 1 root root 18 Jul 8 22:33 Central -> ../SystemV/CST6CDT
- lrwxrwxrwx 1 root root 18 Jul 8 22:33 Eastern -> ../SystemV/EST5EDT
- lrwxrwxrwx 1 root root 37 Jul 8 22:33 East-Indiana -> ../posix/America/Indiana/Indianapolis
- lrwxrwxrwx 1 root root 19 Jul 8 22:33 Hawaii -> ../Pacific/Honolulu
- lrwxrwxrwx 1 root root 24 Jul 8 22:33 Indiana-Starke -> ../posix/America/Knox_IN
- lrwxrwxrwx 1 root root 24 Jul 8 22:33 Michigan -> ../posix/America/Detroit
- lrwxrwxrwx 1 root root 18 Jul 8 22:33 Mountain -> ../SystemV/MST7MDT
- lrwxrwxrwx 1 root root 18 Jul 8 22:33 Pacific -> ../SystemV/PST8PDT
- lrwxrwxrwx 1 root root 18 Jul 8 22:33 Pacific-New -> ../SystemV/PST8PDT
- lrwxrwxrwx 1 root root 20 Jul 8 22:33 Samoa -> ../Pacific/Pago_Pago
- root@Ubuntu#
- SET time_zone='US/Eastern';
- SET time_zone='EST5EDT';
- mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql
- $offset="+10:00";
- $db->exec("SET time_zone='".$offset."';");
- $db->MySQLi->query("SET time_zone='".$offset."';");
Add Comment
Please, Sign In to add comment