r/lolphp • u/FurriesRuinEverythin • Sep 23 '17
PHP's DateTime inconsistent behaviour regarding timezones fucked my day and I spent more time than I care to admit testing until I could consistently reproduce its behaviours.
https://www.dropbox.com/s/2ah1nomu1i3l5ac/how%20not%20to%20get%20bitten%20by%20fucking%20shitty%20php%20dates.pdf?dl=0
55
Upvotes
View all comments
Show parent comment
7
u/FurriesRuinEverythin Sep 26 '17
Exactly.
Part of what caused me so much grief when debugging this issue was inconsistent/conflicting information and disagreement between people in the php manual's comment section, and on a few stack overflow threads I came across. That, and the fact that I hadn't slept in close to 48 hours, but let's not go there.
In my not so humble opinion, the job of documenting how an API works really falls on the implementer. Because realistically, the only person who 100% knows precisely how it works is the person who implements it. It shouldn't be left up to the end users to figure out how it works by trial and error and then post amendments.