I'm getting a weird date ('01/01/1970 00:00:00) when I run the following code in php:
$now = date('d/m/Y H:i:s', time());
$exp = date('d/m/Y H:i:s', strtotime($now .'+100 years'));
I would try something like this
$date = new DateTime();
$exp = $date->modify('+100 years')->format('d/m/Y H:i:s');
Try this code :
<?php
$year = date('Y-m-d H:i:s', strtotime('+5 years'));
echo $year;
?>
Output:
2022-06-26 13:29:07
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With