If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > PHP > Dtaes: one year from the last day of this month

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-07-11, 14:41
oldnickj oldnickj is offline
Registered User
 
Join Date: Jan 2009
Posts: 103
Dtaes: one year from the last day of this month

This code returns the last day of the current month:
<?PHP $dtLastDay = date("j/n/Y", mktime(0, 0, 0, date("m")+1 , date("d")-date("d"), date("Y"))); ?>

What I need is to add one year to this date. OR the last day of the current month one year from now.

Help would be very much appreciated!

Nick
Reply With Quote
  #2 (permalink)  
Old 10-09-11, 00:18
Frunkie Frunkie is offline
Gives Bad Advice
 
Join Date: Mar 2007
Location: 010101010110100
Posts: 791
Try this:

Code:
$current_date = date("Y-m-d");
$future_date = strtotime(date("Y-m-d", strtotime($current_date)) . " +1 year");
echo date('m-d-Y', $future_date);
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On