MySQL FROM_UNIXTIME() with negative timestamp

2011-04-01 by xpheas
The MySQL FROM_UNIXTIME() function does not support negative epoch timestamps, it returns NULL.

I used the DATE_ADD function to work with negative timestamps:
BASH-Code:
1
SELECT DATE_ADD(FROM_UNIXTIME(0), INTERVAL <timestamp> SECOND) FROM <table>

  « back

Feel Free to Leave a Comment

Name:*


Email: (not visible)


Website:


Comment:*