This is absolutely fundamentally wrong. What you’ve described is what Nodatime calls an Instant
, and it’s a very important data class, but there are valid reasons to use other classes.
A LocalDateTime
cares about the date and time locally. An event scheduled for 8am every Monday might use this. It would update accordingly if you move locations to a new locale.
A ZonedDateTime
can almost be directly translated into an Instant
, except that one time zone might change. If you go into or out of daylight saving time, or your region decides to change its time offset. Oslo time is still Oslo time. You use this if your event occurs at a specific time in a specific location.
An OffsetDateTime
is like a ZonedDateTime
, but instead of being tied to a specific time zone (e.g. “Oslo time”) it’s tied to a specific UTC offset (e.g. UTC+1).
You don’t have to use Nodatime, but you should at least think deeply about what your time objects actually represent and what is the best way to represent them.
See the creator of Nodatime’s presentation about thinking deeply about time for more.
Yeah I swear from when Nadella took over until like 2 years ago, Microsoft really seemed to be on the right route. They were becoming the “good guys” of big tech companies.
WSL, actually being really good stewards of GitHub, Chredge actually (at first) being way better for users than Chrome, the amazing revitalisation of some of their oldest and most loved game franchises like Age of Empires and Flight Simulator.
But then recently we’ve had Microsoft adding shitty AI to everything, from Edge to Windows. We’ve had that AoE revitalisation tarnshined by showing off a really shitty official mobile game with all the makings of a typical pay 2 win time sink. The Age of Mythology remake has obvious AI art featured in it despite them insisting no AI was used (though thankfully the actual gameplay is as good as hoped for, at least). We’ve got large layoffs and other shitty corporate bullshit towards workers.