Open HerrNiklasRaab opened 3 years ago
There are not any plans currently to support the ZonedDateTime
type. Based on the documentation I think we could serialize/deserialize the value in string format but it would be very difficult (if even possible) to support any operators/methods for this type. Are you just envisioning being able to store a value for this type in the DB but NOT perform any operations against it?
Hi @StevenRasmussen ,
Just getting my bearings with Noda Time and had the same question about ZonedDateTime. Can I ask why it would be difficult to store in SQL Server? I'm still trying to understand the concepts in Noda Time. Would it be because technically you'd need 2 columns (one for the date/time) and another for the timezone? Thanks again for the package. It's been a lifesaver.
@anthonylevine - Right... the issue is that there's no native SQL type that can store all the information for the ZonedDateTime
NodaTime type. We could put it in a string in SQL, or split it up as you mention, but it becomes extremely difficult (if not impossible) to support any operations against this type in TSQL. We could serialize/deserialize to/from this from a C# perspective but we would be unable to support any operations against it like:
var orders = context.Orders.Where(x => x.ZonedDateTime >= someArbitraryZonedDateTime);
The best we could do is storage and retrieval of the information. Any operations would need to be performed client side. Hopefully that makes sense.
Thank you so much for the detailed reply and totally makes sense. And thanks again for the library.
https://nodatime.org/3.0.x/userguide/zoneddatetime-patterns