akshay Posted July 19, 2010 Share Posted July 19, 2010 Hi. Is there any function in mySQL that returns value in seconds elapsed since January 1 1970 00:00:00 GMT, just like time() function in PHP? I've to select * from database where expiry (in seconds) - <...> is less than so many seconds... [note: where <...> is used to represent the function like time() (php) ] Please help. Thanks Link to comment https://forums.phpfreaks.com/topic/208165-mysql-function-like-time/ Share on other sites More sharing options...
PravinS Posted July 19, 2010 Share Posted July 19, 2010 Try this UNIX_TIMESTAMP(NOW()); Link to comment https://forums.phpfreaks.com/topic/208165-mysql-function-like-time/#findComment-1088085 Share on other sites More sharing options...
akshay Posted July 19, 2010 Author Share Posted July 19, 2010 Yea it works! Thanks a lot! Link to comment https://forums.phpfreaks.com/topic/208165-mysql-function-like-time/#findComment-1088088 Share on other sites More sharing options...
PFMaBiSmAd Posted July 19, 2010 Share Posted July 19, 2010 An even faster version - UNIX_TIMESTAMP(); Link to comment https://forums.phpfreaks.com/topic/208165-mysql-function-like-time/#findComment-1088156 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.