OLG Posted July 10, 2007 Share Posted July 10, 2007 Hey Guys, I was hoping someone could help me out. As the title of the topic suggests in trying to compare to sets of time stamps for a 24 hour or more difference I have a database with a Timestamp field set to CURRENT_TIMESTAMP (so when anything is updated or inserted the timestamp is set to the time that happens) I couldn't find anything relevant either with a google attempt Thanks for your time Link to comment https://forums.phpfreaks.com/topic/59302-comparing-time-stamps/ Share on other sites More sharing options...
Wildbug Posted July 10, 2007 Share Posted July 10, 2007 Subtract the two values; if the absolute value of the difference is greater than 86,400, then ... whatever. Link to comment https://forums.phpfreaks.com/topic/59302-comparing-time-stamps/#findComment-294578 Share on other sites More sharing options...
OLG Posted July 10, 2007 Author Share Posted July 10, 2007 Unfortunately, its stored, mm,dd,yy hh:hh So, i don't think thats quite possible. Link to comment https://forums.phpfreaks.com/topic/59302-comparing-time-stamps/#findComment-294719 Share on other sites More sharing options...
per1os Posted July 10, 2007 Share Posted July 10, 2007 sure it is www.php.net/strtotime Link to comment https://forums.phpfreaks.com/topic/59302-comparing-time-stamps/#findComment-294721 Share on other sites More sharing options...
Wildbug Posted July 11, 2007 Share Posted July 11, 2007 Unfortunately, its stored, mm,dd,yy hh:hh So, i don't think thats quite possible. SELECT ABS(UNIX_TIMESTAMP(ts_col1) - UNIX_TIMESTAMP(ts_col2)) > 86400 FROM tbl; Returns 1 if there is more than a day's difference. Link to comment https://forums.phpfreaks.com/topic/59302-comparing-time-stamps/#findComment-295387 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.