Jump to content

How to make account expire 9 months from today?


peppericious

Recommended Posts

As far as I can see, this code:

$this->_licence_expires = date('Y/m/d', mktime(0, 0, 0, date("m"), date("d")-1, date("Y")));

 

results in accounts expiring 1 year from today, right?

 

How can I change it so that it will result in expiry 9 months from today?

 

TIA

These both should do what you are after

date('Y/m/d', strtotime('+9 month'));
date('Y/m/d', mktime(0, 0, 0, date("m")+9, date("d"), date("Y")));

 

Greatly appreciated, Buddski, thanks. I'll try each of your solutions.

 

For clarity, I should have specified why I wanted to do this: I'm providing access to academic content so I wanted (classroom licensing) to last for the duration of an 'academic year' (i.e. 9 months). I wanted to avoid licences spilling over into a second academic year as far as possible.

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.