tobeyt23 Posted January 25, 2012 Share Posted January 25, 2012 I have a field set as datetime and want to compare that field to see if it is older then ten minutes. Can anyone help I am having a brain fart? Link to comment https://forums.phpfreaks.com/topic/255769-date-and-time/ Share on other sites More sharing options...
scootstah Posted January 25, 2012 Share Posted January 25, 2012 This should work... In an SQL query: ... WHERE date <= DATE_SUB(NOW(), INTERVAL 10 MINUTE) Link to comment https://forums.phpfreaks.com/topic/255769-date-and-time/#findComment-1311109 Share on other sites More sharing options...
PFMaBiSmAd Posted January 25, 2012 Share Posted January 25, 2012 older then Edit: to match your edit... Link to comment https://forums.phpfreaks.com/topic/255769-date-and-time/#findComment-1311111 Share on other sites More sharing options...
tobeyt23 Posted January 25, 2012 Author Share Posted January 25, 2012 Just need to refresh a field if the created date is older than 10 minutes Link to comment https://forums.phpfreaks.com/topic/255769-date-and-time/#findComment-1311117 Share on other sites More sharing options...
scootstah Posted January 25, 2012 Share Posted January 25, 2012 Just need to refresh a field if the created date is older than 10 minutes So add the WHERE clause that I posted to your UPDATE query. Link to comment https://forums.phpfreaks.com/topic/255769-date-and-time/#findComment-1311122 Share on other sites More sharing options...
snushah Posted January 26, 2012 Share Posted January 26, 2012 Try with WHERE DATETIME = '#2011-08-30 01:15:24#' Link to comment https://forums.phpfreaks.com/topic/255769-date-and-time/#findComment-1311281 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.