0

How should I convert historic local time to UTC taking into account of daylight saving?

The main problem is the daylight saving doesn't occur at a fixed period every year and hence I cannot think of a way to do this task.

1

1 Answer 1

2

See https://github.com/mj1856/SqlServerTimeZoneSupport by Matt Johnson for Sql Server 2008R2+.

2
  • do we have anything similar to from_tz of oracle in SQL Server or any other builtin function that does the job? Commented Jun 24, 2016 at 4:46
  • Really from_tz only marks datetime with the timezone. Operator for converting the value is AT TIME ZONE . It was introduced in Sql Server 2016.
    – Serg
    Commented Jun 24, 2016 at 7:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.