monkeybidz Posted October 17, 2007 Share Posted October 17, 2007 What would i do to have this date display tomorrow's date or 24 hours later without changing the server time? $tiempo = date('l dS \of F Y h:i:s A'); Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted October 17, 2007 Share Posted October 17, 2007 Use the strtotime() function: <?php $tiempo = date('l dS \of F Y h:i:s A',strtotime('tomorrow')); ?> or <?php $tiempo = date('l dS \of F Y g:i:s A',strtotime('+24 hours')); ?> Ken Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted October 17, 2007 Share Posted October 17, 2007 Beat to it, and in a better way. I forgot we can strtotime('tomorrow'). Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted October 17, 2007 Share Posted October 17, 2007 oops, except on my system where the h:i:s defaults to 00:00:00 (midnight). if you don't care about leap days, you could use: $tomorrow = time() + 86400; $tiempo = date('l dS \of F Y h:i:s A', $tomorrow); or Ken's second suggestion Quote Link to comment Share on other sites More sharing options...
monkeybidz Posted October 17, 2007 Author Share Posted October 17, 2007 I don't really need the time, it's the date that i need to show tomorrow. Quote Link to comment Share on other sites More sharing options...
monkeybidz Posted October 17, 2007 Author Share Posted October 17, 2007 Thank's! both methods worked. 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.