Hunt
Hunt

Reputation: 8425

timestamp is not getting converted in mysql

i have a field in Table A named sentDate of type bigint(20) which stores the timestamp value. now when i want to use sentDate field's value into Table B to perform some query operation i am not getting any results.

to debug that i tried following

select FROM_UNIXTIME(sentDate) from Table A;

but i am getting all NULL values , it seems its not converting the time stamp value properly.

i want to use sentDate in a Table B ( using subquery ) but as sentDate is not being converted properly i am getting null result.

sample timestamp value is 1403944186539 ,i have tried this timestamp on http://www.epochconverter.com/ online tool and its showing results there

Upvotes: 1

Views: 65

Answers (1)

ashok_p
ashok_p

Reputation: 749

try this , You are giving millisecond but from_unixtime takes second since 1/1/1970.

select FROM_UNIXTIME(sentDate/1000) from Table A;

Upvotes: 1

Related Questions