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'); Link to comment https://forums.phpfreaks.com/topic/73691-solved-altering-date/ 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 Link to comment https://forums.phpfreaks.com/topic/73691-solved-altering-date/#findComment-371782 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'). Link to comment https://forums.phpfreaks.com/topic/73691-solved-altering-date/#findComment-371784 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 Link to comment https://forums.phpfreaks.com/topic/73691-solved-altering-date/#findComment-371785 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. Link to comment https://forums.phpfreaks.com/topic/73691-solved-altering-date/#findComment-371816 Share on other sites More sharing options...
monkeybidz Posted October 17, 2007 Author Share Posted October 17, 2007 Thank's! both methods worked. Link to comment https://forums.phpfreaks.com/topic/73691-solved-altering-date/#findComment-371898 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.