SqlServerTimeZoneSupport
SqlServerTimeZoneSupport copied to clipboard
Need a ToDateTimeOffset function
We have no direct function to convert datetime or datetime2 values to datetimeoffset with the correct offset for a particular time zone.
It can be done with two functions, as in:
Tzdb.SwitchZone(Tzdb.LocalToUtc(@local, @tz, 1, 1), @tz)
But this should be wrapped in a single function.
And while wrapping the above will work, it could probably be written better as a single lookup against the Interval table.