The problem with dates

The problem with dates

PHP Annotated

7 месяцев назад

3,500 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@solobot
@solobot - 06.12.2023 11:22

And we didnt even start talking about Timezones 😬

Ответить
@fairphoneuser9009
@fairphoneuser9009 - 22.12.2023 17:05

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? 😁

Ответить
@matbaric
@matbaric - 07.12.2023 10:22

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.

Ответить
@TroyNiemeier
@TroyNiemeier - 06.12.2023 19:19

YES.
Must distinguish between "clever" and "tricky". I'd prefer programmers stop using "tricky" coding tricks, or cryptic codes within codes.

Ответить
@jan6347
@jan6347 - 06.12.2023 17:19

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. 😁

Ответить
@PaulRijke
@PaulRijke - 06.12.2023 17:12

I absolutely adore simple code.

Ответить
@jimbo2150
@jimbo2150 - 06.12.2023 16:51

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.

Ответить
@DanielOpitz
@DanielOpitz - 06.12.2023 15:18

Also, make sure, that the two DateTimeImmutable objects are in the same TimeZone. Otherwise, the results will be unexpected.

Ответить
@Operaatoors
@Operaatoors - 06.12.2023 13:52

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

Ответить
@alsuara
@alsuara - 06.12.2023 13:39

I agree with you

Ответить
@metaphoricallyspeaking
@metaphoricallyspeaking - 06.12.2023 12:55

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! 🤣

Ответить
@yousuftafhim4888
@yousuftafhim4888 - 06.12.2023 12:39

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

Ответить
@markuszeller_official
@markuszeller_official - 06.12.2023 12:21

Woman are more complicated on dates than PHP.

Ответить
@hatchnhatch
@hatchnhatch - 06.12.2023 12:21

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? :)

Ответить
@barneylaurance1865
@barneylaurance1865 - 06.12.2023 11:36

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.

Ответить
@krisrudecki9477
@krisrudecki9477 - 06.12.2023 11:32

Half of my work is making sure PHP is not too "clever" on its own 😂

Ответить