Jump to content

[SOLVED] Question on proper usage of "date" and "mktime" functions.


CaseyC1

Recommended Posts

Due to new requirements from Google, I have to add a few new parameters to a delimited text file that I upload to Google to list the products that I sell in my online store.

 

One of the new params is an "expiration date" of the item. This date can only be a maximum of 31 days from the date of the upload. Using the "date" and "mktime" functions I have constructed the following:

 

$nextmonth = mktime(0,0,0, date("m")+1, date("d"), date("Y"));

$exp_date  = date("Y-m-d", $nextmonth);

 

Is the "mktime" function smart enough to increment the "Y" on rollover or do I have to take care of that?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.