stringtotime icon indicating copy to clipboard operation
stringtotime copied to clipboard

interpretation of am/pm flag for hour twelve (12) is reversed

Open Osndok opened this issue 11 years ago • 0 comments

Hey, I just noticed this issue while testing edge cases:

strtotime('2014-05-14 0:23') -> 2014-05-14 00:23:00.000
strtotime('2014-05-14 0:23p') -> 2014-05-14 12:23:00.000
strtotime('2014-05-14 1:23') -> 2014-05-14 01:23:00.000
strtotime('2014-05-14 1:23p') -> 2014-05-14 13:23:00.000
strtotime('2014-05-14 12:34') -> 2014-05-14 12:34:00.000
strtotime('2014-05-14 12:34a') -> 2014-05-14 12:34:00.000 <-- !!!
strtotime('2014-05-14 12:34am') -> 2014-05-14 12:34:00.000 <-- !!!
strtotime('2014-05-14 12:34p') -> 2014-05-15 00:34:00.000 <-- !!!
strtotime('2014-05-14 12:34pm') -> 2014-05-15 00:34:00.000 <-- !!!

I might have time to fix it myself a bit later, but thought it good to document it right away (so others can know if I do forget or get swamped).

Osndok avatar Aug 15 '14 18:08 Osndok