Question

I am trying to search my DB for records with a certain day recorded against them, where that record is a UNIX timestamp. Here is an example of one of those timestamps:

1389026993

That date is Mon, 06 Jan 2014 16:49:53 GMT

However I'm finding that my select statement

SELECT FROM_UNIXTIME('join_date')

returns this:

1970-01-01 01:00:00

Am I going wrong somewhere?

Était-ce utile?

La solution

Remove the single quote otherwise you are passing a string as the parameter.

SELECT FROM_UNIXTIME(join_date)
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top