Just to clarify, when he said that offset will not necessarily give you the time-zone. It's because a time-zone is a geographical area, and can sometimes change which offset they are using from UTC. A common example being daylight savings. Central Standard Time aka CST uses a -6 offset, and CDT which uses a -5 offset. Although someone living in the time-zone can have CST be it's offset one period of the year and CDT be it's offset the other portion of the year.
Would like to see Microsoft have a better solution by calculating UTC time based on local time and Country/State. Many times you only know local time of the event, and then maby country / country+state, example tracking events from carriers. And in DB you might need to store localtime and UTC ( which is unknown). Think NodaTime has some support, but it is still not great, it need to be combined with more packages to have a good solution for the problem. example: event happend "2024-07-14 15:30:45" in Poland. Would like to translate this to correct UTC time
Hi, at 7:45 in video you mention that sometime there is a need to store timezone as well... Do you have any reference on how to do it? For example is there DateTimeZone type and how does this relate to the database? What is you preferred approach to this? Thanks!
I would store the Timezone ISO code as a different column in your DB. Or, take a look at Noda Time. You have there the ZonedDateTime type that will help you out.
Thanks, Gui! I've actually never understood why we need DateTimeOffset - until now!
Wow! That comment made my day! Thank you Davide!
2:40 The choice of words here makes a confusing subject harder to understand
Great video 💪🏼 thanks man!
Glad you liked it, Amichai! 🙏
Just to clarify, when he said that offset will not necessarily give you the time-zone. It's because a time-zone is a geographical area, and can sometimes change which offset they are using from UTC. A common example being daylight savings. Central Standard Time aka CST uses a -6 offset, and CDT which uses a -5 offset. Although someone living in the time-zone can have CST be it's offset one period of the year and CDT be it's offset the other portion of the year.
Thanks for adding that 🙏 perfect 👌
Great video!
Thank you 🙇
Would like to see Microsoft have a better solution by calculating UTC time based on local time and Country/State.
Many times you only know local time of the event, and then maby country / country+state, example tracking events from carriers.
And in DB you might need to store localtime and UTC ( which is unknown). Think NodaTime has some support, but it is still not great, it need to be combined with more packages to have a good solution for the problem.
example: event happend "2024-07-14 15:30:45" in Poland. Would like to translate this to correct UTC time
Hi, at 7:45 in video you mention that sometime there is a need to store timezone as well...
Do you have any reference on how to do it? For example is there DateTimeZone type and how does this relate to the database? What is you preferred approach to this?
Thanks!
I would store the Timezone ISO code as a different column in your DB.
Or, take a look at Noda Time. You have there the ZonedDateTime type that will help you out.
Enable subtitles to understand him.
My brain hurts.
I'm concerned