Typecast to UNIX_TIMESTAMP inside the query:
SELECT UNIX_TIMESTAMP(YourDateField) FROM YourTable
Since I see responses to the other answer while this is ignored, let me elaborate:
There are two common date types. Both are actually numbers, that represent a duration since a given date.
- One is the number of days (float)
since 1900. One is one day. The
fraction is the fraction of the day.
- Other is the number of seconds since 1970. This can be an int (whole seconds) or a float (including fractional seconds).
If you got the first date, but treat it like the second format, you arecounting days for seconds. Instead of 111 years since 1900, you're counting 111 seconds since 1970. That explains why you get that date.
Therefore, use the UNIX_TIMESTAMP function, which will convert the first float notation to a timestamp in seconds. It is needed because that is also the type PHP uses.