Комментарии:
And we didnt even start talking about Timezones 😬
ОтветитьI've been messing around with dates in PHP and JS recently and I really enjoyed your video because of this. Am I a masochist? 😁
ОтветитьNice one Brent, as usual strict approach is the best. And we are leaning towards Java heavily and strictness all the way. Which I endorse as well FYI. This loose ends and wild goose chase days in PHP are coming to it's end.
ОтветитьYES.
Must distinguish between "clever" and "tricky". I'd prefer programmers stop using "tricky" coding tricks, or cryptic codes within codes.
That's still better than JavaScript where you have the Date class which accepts year, month and day, where "day" is a number between 1 and 31 (obviously), but "month" is a number between 0 and 11. 😁
ОтветитьI absolutely adore simple code.
ОтветитьPersonally, I think the date period is fine. It includes the option to include the end date and I use it. I don't need it to be the default.
ОтветитьAlso, make sure, that the two DateTimeImmutable objects are in the same TimeZone. Otherwise, the results will be unexpected.
ОтветитьThis week tech debt I am working exactly with this kind of crap. I always have to relearn how to deal with periods when db entries are stored in gmt, but client timezone is another… there are solutions but I have to remember and seek
ОтветитьI agree with you
ОтветитьGreat video Brent. Working with dates and times have so many edge cases. Always seems simple and intuitive at first, but before too long that feeling gets yanked from us! 🤣
ОтветитьIt has to be cleared when discussing the problem or providing the solution then make it standard in communication throughout. Easier said than done though.
I deal with dates in Unix Timestamp makes it easier
Woman are more complicated on dates than PHP.
ОтветитьI remember getting very upset with my maths teacher in 2nd grade when we discussed how many stations I'd be taking by train. Does or doesn't the count include the station you're getting into the train at? :)
ОтветитьHas anyone here tried the brick/date-time library? I've been wanting to try it in a real application for year but never found good time to do it. I like how instead of just one class for your values it makes you choose between about a dozen different classes so you get to express exactly what you mean much more clearly. E.g. is it a timestamp, or a local time, or just a date without a time? Different classes, none of which inherit from each other.
ОтветитьHalf of my work is making sure PHP is not too "clever" on its own 😂
Ответить