TimUSA Posted January 14, 2008 Share Posted January 14, 2008 I dont really understand the PHP time functions yet so I will ask this here before I have hours of headaches! What I am trying to accomplish is something like this: get current date/time UTC if current date/time is Tuesday 23:00 UTC than $date1 = "date(m/d+1/Y H+2:M UTC" can someone please help me? Quote Link to comment https://forums.phpfreaks.com/topic/86017-question-about-time-functions/ Share on other sites More sharing options...
kickassamd Posted January 14, 2008 Share Posted January 14, 2008 1 your synax is incorrect should be date("m/d/Y") read the PHP manual for the date function. http://us3.php.net/date Quote Link to comment https://forums.phpfreaks.com/topic/86017-question-about-time-functions/#findComment-439277 Share on other sites More sharing options...
TimUSA Posted January 14, 2008 Author Share Posted January 14, 2008 sorry what I was trying to express here was than $date1 = "date(m/d+1/Y H+2:M UTC" where d=current day +1 and H = current Hour + 2 Quote Link to comment https://forums.phpfreaks.com/topic/86017-question-about-time-functions/#findComment-439280 Share on other sites More sharing options...
revraz Posted January 14, 2008 Share Posted January 14, 2008 If you want to add 1 day and 2 hours to that, you'll need to do it by adding that many seconds to date. Quote Link to comment https://forums.phpfreaks.com/topic/86017-question-about-time-functions/#findComment-439286 Share on other sites More sharing options...
TimUSA Posted January 15, 2008 Author Share Posted January 15, 2008 ok so still a bit confused, how would I add 1 day and 2 hours to this for $newdate = if (gmdate("l H:m") >= "Tuesday 17:00") { $newdate = gmdate("m/d/Y H:i e"); echo $newdate; } Quote Link to comment https://forums.phpfreaks.com/topic/86017-question-about-time-functions/#findComment-440082 Share on other sites More sharing options...
TimUSA Posted January 15, 2008 Author Share Posted January 15, 2008 which is 93600 seconds btw, whats the deal with a time limit on modifying a post?? Quote Link to comment https://forums.phpfreaks.com/topic/86017-question-about-time-functions/#findComment-440084 Share on other sites More sharing options...
revraz Posted January 15, 2008 Share Posted January 15, 2008 http://www.phpfreaks.com/forums/index.php/topic,122015.0.html Quote Link to comment https://forums.phpfreaks.com/topic/86017-question-about-time-functions/#findComment-440093 Share on other sites More sharing options...
The Little Guy Posted January 15, 2008 Share Posted January 15, 2008 <?php echo date("m/d/Y H:M e",strtotime("Tuesday 23:00 UTC")); ?> Quote Link to comment https://forums.phpfreaks.com/topic/86017-question-about-time-functions/#findComment-440113 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.