Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine if daylight saving time is active? SQL Server

Tags:

sql

dst

I have a table with users, UTC time offset, and if they observe daylight saving time. Is there a built in way to get the correct user time?

like image 951
NitroxDM Avatar asked Mar 12 '26 11:03

NitroxDM


1 Answers

The sys.time_zone_info table introduced in SQL 2016 allows to determine the offset from UTC and whether DST is currently in effect.

SELECT * FROM sys.time_zone_info

The query result will be:

like image 100
Anacv Avatar answered Mar 14 '26 07:03

Anacv



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!