joshuaceo Posted January 3, 2009 Share Posted January 3, 2009 Is it possible to show todays date but 29 days after: How would I do this on this code below: $expdate = gmdate("Y-m-d"); Also just incase it is not possible. Is there a way to show todays date in exactly this format: 2009-01-02 Quote Link to comment Share on other sites More sharing options...
xtopolis Posted January 3, 2009 Share Posted January 3, 2009 strtotime As for your other question... Yes. date Quote Link to comment Share on other sites More sharing options...
Nitroware Posted January 3, 2009 Share Posted January 3, 2009 Also try mktime(): <?php $time=date("Y-m-d",mktime(0, 0, 0, date("m") , date("d")+29, date("Y"))); ?> Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted January 3, 2009 Share Posted January 3, 2009 Example: $expdate = gmdate("Y-m-d"); echo $expdate . "\n"; echo date('Y-m-d',strtotime($expdate . ' +29 days')) . "\n"; ?> Ken Quote Link to comment Share on other sites More sharing options...
corbin Posted January 3, 2009 Share Posted January 3, 2009 Why not just use now? echo date('Y-m-d', strtotime('now +29 days')); Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted January 3, 2009 Share Posted January 3, 2009 Actually, you don't even need the 'now': <?php echo date('Y-m-d',strtotime('+29 days')); ?> Ken 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.