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? Quote 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) Quote 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... Quote 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 Quote 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. Quote 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#' Quote Link to comment https://forums.phpfreaks.com/topic/255769-date-and-time/#findComment-1311281 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.