I've read that SQL Server:
- uses system time zone on Windows (reg key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\TimeZoneKeyName
) - uses
TZ
env var on Linux or/etc/timezone
.
I wonder what happens with data stored in DB if I change system time zone on the server and restart it.
Should I see the same dates/time returned by columns of type datetime2
via JDBC / ODBC API?
Will there be a gap equals to TZ difference after the change?
Doesn't that ruin technique of storing data in UTC? Like you are obligated not only to "normalize" dates (to UTC) but also keep SQL Server instances running in UTC...