SCook Posted December 3, 2007 Share Posted December 3, 2007 Hi all, Is there a way, or a built in function, that I can send in a date, and an increment, 7 days later, for example, and the function would kick back the calander date in mm/dd/yyyy? For example: $newDate = getNewDate('12/3/2007', 7); and it would kick out '12/9/2007'? or whatever is neccesary? The reaosn is that instead of creating code to figure it out, there mustbe a way that it can be donw automaticcally. After all, the bios knows the calendar. Any suggestions would be greatly appreciated Quote Link to comment Share on other sites More sharing options...
pcman Posted December 3, 2007 Share Posted December 3, 2007 like that?: <?php $new_date = time()+7*24*60*60;//the future date ?> Quote Link to comment Share on other sites More sharing options...
Orio Posted December 3, 2007 Share Posted December 3, 2007 Use strtotime(): <?php $timestamp = strtotime($date) + strtotime("+7 days") - time(); echo date("...", $timestamp); //choose the format ?> Orio. 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.