yoursurrogategod Posted November 6, 2012 Share Posted November 6, 2012 I have this piece of PHP code: function OffsetDate($dayFraction, $date = false) { if(!$date) { $date = 'CURDATE()'; } $fraction = $dayFraction * 24 * 3600; return $date . ' + INTERVAL ' . $fraction . ' SECOND'; } If I were to put in -28 as an input value (and only that value), this is the result that I would get: "CURDATE() + INTERVAL 2419200 SECOND " What will that SQL code do? What does it mean? I have to maintain this PHP code, but I don't quite understand how this SQL would work in a simulated environment. Quote Link to comment Share on other sites More sharing options...
Jessica Posted November 6, 2012 Share Posted November 6, 2012 It would give you the sum of the current date plus that many seconds. Quote Link to comment Share on other sites More sharing options...
Barand Posted November 6, 2012 Share Posted November 6, 2012 for example http://forums.phpfreaks.com/topic/270336-how-would-i-go-about-adding-to-the-current-date-in-mysql/?do=findComment&comment=1390431 Quote Link to comment 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.