I'm trying to schedule maintenance notifications based on the date last completed + a date time interval selected by the user. I tried using strtotime but found it unreliable with leap years, short months, etc. The original drop down list was based on this array.
$this->freq_ops = array(
'1 weekdays' => 'Every day',
'2 weekdays' => '2 days',
'3 weekdays' => '3 days',
'1 weeks' => 'Every week',
'2 weeks' => '2 weeks',
'3 weeks' => '3 weeks',
'1 months' => 'Every month',
'2 months' => '2 months',
'3 months' => '3 months',
'6 months' => '6 months',
'9 months' => '9 months',
'1 years' => 'Every year',
'3 years' => '3 years',
'5 years' => '5 years');
Now I'm trying to use DateTime objects. What's the ideal method to store a date time interval in MySQL and still show a friendly (or somewhat friendly) text string representation in the interface?