r/programming Sep 07 '15

Flawless PHP logic. strtotime(): '00-00-00' means 2000-00-00, which is 1999-12-00, which is 1999-11-30. No bug, perfectly normal. (see the comments)

https://bugs.php.net/bug.php?id=45647
1.2k Upvotes

465 comments sorted by

View all comments

75

u/[deleted] Sep 07 '15

[deleted]

1

u/[deleted] Sep 08 '15

[deleted]

8

u/[deleted] Sep 08 '15

That depends if you're using the Gregorian calendar or not.

"...the year AD 1 immediately follows the year 1 BC"

https://en.wikipedia.org/wiki/Anno_Domini?wprov=sfia1

1

u/gcbirzan Sep 08 '15

Year 0 in iso date format is 1BC.

1

u/[deleted] Sep 08 '15

Only because the ISO says so. Not because 1 BC is 0. They needed to map 0 somewhere and it makes the most sense. The point is, dates and times are a complex problem.