Jump to content

Strtotime() Question


tqla

Recommended Posts

Hello. I do not need to know how to write this another way. I just am curious as to why this happens.

 

Why does strtotime() print the expected result when I add 25 years:

 

<?php
$thedate = date('D M Y', strtotime("+25 year"));
echo $thedate;
?>

 

But it fails to print the expected result when I add 26 years. Instead it reads "Wed Dec 1969"

 

<?php
$thedate = date('D M Y', strtotime("+26 year"));
echo $thedate;
?>

 

Is it my version of PHP? Is there a 25 year limit? Does this happen on your system?

 

:confused:

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/270705-strtotime-question/
Share on other sites

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.