The-Last-Escape Posted May 3, 2007 Share Posted May 3, 2007 Ok, I am getting the date like this $date = strtotime(date()); ok, there you have it, a Unix time stamp of the time, date, and everything else. From here, is this the best way to do calculations. Like if I wanted to tell when 48 hours had passed from this date, how do I go about doing that. I know for example if you wanted to add a day, you check on how many "number's" here are in a day and put + that number onto the strength. Can someone tell me some stuff about this, so I am more familiar with dates, before I start all of these calculations. Quote Link to comment Share on other sites More sharing options...
thedarkwinter Posted May 3, 2007 Share Posted May 3, 2007 Hi you may want to look at the funtion mktime(): http://uk.php.net/mktime Using this u can do things like mktime(date("h"),date("i"),date("s")+10) to add 10 seconds to the current time etc,or $date = time() + mktime(0,0,0,0,2,0); will return now + 2 days. Hope that helps, cheers tdw Quote Link to comment Share on other sites More sharing options...
The-Last-Escape Posted May 3, 2007 Author Share Posted May 3, 2007 Thanks Quote Link to comment Share on other sites More sharing options...
Barand Posted May 3, 2007 Share Posted May 3, 2007 $now = time(); $nowPlus48 = strtotime('+48 hours'); echo date('m/d/Y H:i', $nowPlus48); http://www.php.net/strtotime Quote Link to comment Share on other sites More sharing options...
The-Last-Escape Posted May 3, 2007 Author Share Posted May 3, 2007 Cheers 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.