chaking Posted December 11, 2009 Share Posted December 11, 2009 Is it possible to select a datetime field as a unix timestamp? I was selecting the string and then converting with `strtotime` but that leaves off the seconds, so if there's a built in function that would be great - Link to comment https://forums.phpfreaks.com/topic/184826-select-datetime-as-unx-timestamp/ Share on other sites More sharing options...
chaking Posted December 12, 2009 Author Share Posted December 12, 2009 The answer would be: SELECT stamp = DATEDIFF(s, '19700101', column) FROM EVENTS WHERE column > 'xxx' Link to comment https://forums.phpfreaks.com/topic/184826-select-datetime-as-unx-timestamp/#findComment-975742 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.