EchoFool Posted April 2, 2010 Share Posted April 2, 2010 Hey similiar to how mysql has a datediff() is there PHP version where you can choose it to either turn in minutes/days or what ever you choose something like: function comparedate($Timestamp,servertime()){} Quote Link to comment Share on other sites More sharing options...
teamatomic Posted April 2, 2010 Share Posted April 2, 2010 $servertime=date("U"); if($Timestamp > $servertime) {echo "Future";} else {echo "Past";} HTH Teamatomic Quote Link to comment Share on other sites More sharing options...
ignace Posted April 2, 2010 Share Posted April 2, 2010 date_diff Quote Link to comment Share on other sites More sharing options...
EchoFool Posted April 2, 2010 Author Share Posted April 2, 2010 Okay date_diff seems over complex compared to mysql's method. Quote Link to comment Share on other sites More sharing options...
ignace Posted April 2, 2010 Share Posted April 2, 2010 Depends on what you consider complex. echo date_diff($timestamp)->format('%d days %i minutes'); 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.