Saturday 20 May 2017

What is the difference between Unix timestamps and MySQL timestamps?

Internally both Unix timestamps and MySQL timestamps are stored as 32-bit integers.While MySQL timestamps are represented in readable format of YYYY-MM-DD HH:MM:SS and UNIX_TIMESTAMP(), if called with no argument, returns a Unix timestamps (seconds since '1970-01-01 00:00:00' UTC) as an unsigned integer. If UNIX_TIMESTAMP() is called with a date argument, it returns the value of the argument as seconds since '1970-01-01 00:00:00' UTC. date may be a DATE string, a DATETIME string, a TIMESTAMPS, or a number in the format YYMMDD or YYYYMMDD.

No comments:

Post a Comment

Advertisement

Advertisement