[MDEV-7928] MySQL time is not aware of timezone settings Created: 2015-04-07  Updated: 2022-09-08

Status: Open
Project: MariaDB Server
Component/s: Data types, Temporal Types, Time zones
Affects Version/s: 5.5, 10.0
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Vincent Kéravec Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: datatype, upstream
Environment:

Linux


Epic Link: Data type cleanups

 Description   

MySQL is not timezone aware while calculating time.
Link to a related MySQL bug http://bugs.mysql.com/bug.php?id=68832

MariaDB [(none)]> select @@session.time_zone;
| @@session.time_zone |
| Europe/Oslo         |
1 row in set (0.00 sec)
 
MariaDB [(none)]> SELECT FROM_UNIXTIME(UNIX_TIMESTAMP('2015-03-29 02:00:00'));
| FROM_UNIXTIME(UNIX_TIMESTAMP('2015-03-29 02:00:00')) |
| 2015-03-29 03:00:00                                  |
1 row in set (0.00 sec)
 
MariaDB [(none)]> SELECT CAST('2015-03-29 02:00:00' as DATETIME);
| CAST('2015-03-29 02:00:00' as DATETIME) |
| 2015-03-29 02:00:00                     |
1 row in set (0.00 sec)
MariaDB [(none)]> SELECT CAST('2015-03-29 01:00:01' as DATETIME)+INTERVAL 1 HOUR;
| CAST('2015-03-29 01:00:01' as DATETIME)+INTERVAL 1 HOUR |
| 2015-03-29 02:00:01                                     |
1 row in set (0.00 sec)
 
MariaDB [(none)]> SELECT FROM_UNIXTIME(UNIX_TIMESTAMP('2015-03-29 01:00:01')+3600);
| FROM_UNIXTIME(UNIX_TIMESTAMP('2015-03-29 01:00:01')+3600) |
| 2015-03-29 03:00:01                                       |
1 row in set (0.00 sec)


Generated at Thu Feb 08 07:23:20 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.