Reputation: 383
I have this as expiry date
$expiryDate = new DateTime();
But that puts expiry date to today time. How can i add 5 years in that time
Upvotes: 2
Views: 8199
Reputation: 160873
Check DateTime::modify
$expiryDate->modify('+5 year');
or
$expiryDate = new DateTime('+5 year');
Upvotes: 9