Yurii Korotia
unread,Jul 18, 2011, 3:56:30 AM7/18/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Joomla! General Development
I guess you didn't catch the idea.
mysql> create table a (t timestamp, d datetime);
Query OK, 0 rows affected (0.14 sec)
mysql> insert a (d) values (now());
Query OK, 1 row affected (0.02 sec)
mysql> select * from a;
+---------------------+---------------------+
| t | d |
+---------------------+---------------------+
| 2011-07-18 10:12:41 | 2011-07-18 10:12:41 |
+---------------------+---------------------+
1 row in set (0.00 sec)
now I change timezone and restart sql server (i don't have timezone
table)
mysql> select * from a;
+---------------------+---------------------+
| t | d |
+---------------------+---------------------+
| 2011-07-18 11:12:41 | 2011-07-18 10:12:41 |
+---------------------+---------------------+
1 row in set (3.03 sec)
as you may see, timestamp always returns time according to your
current server's timezone, as timestamp saves data as UTC.
By ther way, Mike,
I have tried to set timezone but it doesn't change my output from
mysql:
date_default_timezone_set('UTC');
as it changes timezone used by datetime() class of php and so on, not
mysql