1SELECT CONVERT(datetime, SWITCHOFFSET(GETUTCDATE(), DATEPART(TZOFFSET,2GETUTCDATE() AT TIME ZONE 'Arabian Standard Time'))) AS CreationTime
Replace GETUTCDATE()
with your table column that has the UTC time.
1SELECT CONVERT(datetime, SWITCHOFFSET(GETUTCDATE(), DATEPART(TZOFFSET,2GETUTCDATE() AT TIME ZONE 'Arabian Standard Time'))) AS CreationTime
Replace GETUTCDATE()
with your table column that has the UTC time.
This page is open source. Noticed a typo? Or something unclear?
Improve this page on GitHub
Written byEdson Frainlar Follow @FrainlarEdson
Mission-driven Full-stack Developer with a passion for developing KTern, Dev Collaboration, and teaching. Curious to explore Quantum Information and Computing.
Connect
Using SQL Data Sync for Bidirectional Data Replication in SQL Server & Azure SQL DBs | Data Exposed
Build fast, scalable data system on Azure SQL Database Hyperscale | Clearent
SQL Server 2017 Graph Database