[MDEV-9608] FROM_UNIXTIME same date time from two different timestamp Created: 2016-02-22 Updated: 2016-02-22 Resolved: 2016-02-22 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Temporal Types |
| Affects Version/s: | 10.0.23-galera |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Enne Fayen | Assignee: | Sergei Golubchik |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
CentOS 64 bit |
||
| Attachments: |
|
| Description |
|
I am having a weird problem with mariadb. I am using FROM_UNIXTIME to convert timestamp to datetime. The problem is two different timestamp is resulting to same datetime. How can it be possible? Here what I got from mariadb-
Output on my timezone-
Another example:
Output on my timezone-
This is wrong because no two different timestamp should return same date time. I have attached screenshot proof of output that I got via phpmyadmin. Version info-
|
| Comments |
| Comment by Elena Stepanova [ 2016-02-22 ] |
|
Did you try to run the same queries via MySQL client, not using phpmyadmin? It would be good to rule out that it gets messed up in the tool or connector. |
| Comment by Sergei Golubchik [ 2016-02-22 ] |
|
This is normal and not a bug. TIMESTAMP values are defined as number of second since 1970-01-01 00:00:00 UTC. It always increases by one for every second that passed. DATETIME is different. It's the time in your current time zone and it does not always increase. In particular, when you switch to Daylight Saving Time the time in your time zone goes one hour back. But TIMESTAMP value does not. So it is, indeed, possible to have two different TIMESTAMP values that correspond to the "same" DATETIME value. Because your clock have, indeed, displayed the same time twice. You, apparently, have switched to DST at 2016-02-21 00:00:00, and have lived the hour of |