3 ms·
I like to rip on MySQL as much as the next guy, but the article is incorrect about MySQL DATETIMEs: DATETIME: Eight bytes: A four-byte integer packed as YYYY×1
by lysol 15y ago
I like to rip on MySQL as much as the next guy, but the article is incorrect about MySQL DATETIMEs:
DATETIME: Eight bytes:
A four-byte integer packed as YYYY×10000 + MM×100 + DD
A four-byte integer packed as HH×10000 + MM×100 + SS
Storing UNIX time as an integer would be silly, considering:
TIMESTAMP: A four-byte integer representing seconds UTC since the epoch ('1970-01-01 00:00:00' UTC)
- troels 15y agoMySql's datetime fields are not timezone aware. If one client has set one timezone and inserts a value in a datetime field and another client has a different timezone, the value will not be converted.
- deleted 15y ago[deleted]
- lysol 15y agoNot sure that's contradictory to my point about the backend storage. The overall points in the article are correct but its note about how MySQL stores its DATETIMEs is strange, and I'd hate to make people think MySQL is a bad database because of incorrect information, instead of things like the lack of transactional DDL.