Quote:
Originally Posted by elitis
It is stored in a timestamp format, but is still displaying December 31, 1969 4:33 PM
EDIT:Still not sure what was the issue but got it displaying the correct date by calling it through the strotime() function.
|
Yeah this is where it gets confusing.
Timestamp in MySQL is a [more or less] datetime type that has been given an explicit range (from epoch to 32bit max [ie: January 19, 2038 @ 03:14:07; the real year 2000]). So its represented internally as a number, while datetime would be a string. When passed to PHP, it is a string, not a number.
Timestamp in PHP is an integer. Using the UNIX_TIMESTAMP returns the integer timestamp result of the MySQL TIMESTAMP so that PHP can make use of it as a $timestamp in its date functions.