CodeMama Posted February 19, 2009 Share Posted February 19, 2009 I need to get this to work, it should print out the date two days from now : <?php $startday = mktime( 0,0,0, date("m") , date("d")+2, date("Y")); echo ("$startday"); ?> But this is what I get: $startday = 1234947089 So am I doing it wrong, as in those results are garbage ??? or am I missing some code to format it? Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/145840-solved-timedate-formatting-question/ Share on other sites More sharing options...
blueman378 Posted February 19, 2009 Share Posted February 19, 2009 its giving you the unix timestamp now convert that to a date with http://nz.php.net/manual/en/function.date.php Quote Link to comment https://forums.phpfreaks.com/topic/145840-solved-timedate-formatting-question/#findComment-765706 Share on other sites More sharing options...
samshel Posted February 19, 2009 Share Posted February 19, 2009 <?php $startday = date("d-M-Y", mktime( 0,0,0, date("m") , date("d")+2, date("Y"))); echo ("$startday"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/145840-solved-timedate-formatting-question/#findComment-765707 Share on other sites More sharing options...
The Little Guy Posted February 19, 2009 Share Posted February 19, 2009 <?php $startday = mktime( 0,0,0, date("m") , date("d")+2, date("Y")); echo date("Y-m-d",$startday); ?> Quote Link to comment https://forums.phpfreaks.com/topic/145840-solved-timedate-formatting-question/#findComment-765708 Share on other sites More sharing options...
CodeMama Posted February 19, 2009 Author Share Posted February 19, 2009 Thanks so much guys! Quote Link to comment https://forums.phpfreaks.com/topic/145840-solved-timedate-formatting-question/#findComment-765710 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.