How to convert existing datetime into UTC in SQL Server

There would be situations where in an application would have developed ages ago not considering to support multi time zone but later you realise and want to handle the same, when the application is already on production for couple of months or years. Recently I had to do a migration, where I had to update existing datetime field’s data and format it into UTC (Coordinated Universal Time) to neutralise the time zone.

So far there is no direct functions or format available in SQL Server to format an existing date into UTC. I had to tweak and play around with few inbuilt date functions to achieve the same.

 

Prasad Sahoo

Prasad Sahoo, is an enthusiast of Microsoft technologies in general and a passionate database professional, mainly focusing on SQL Server performance tuning and business intelligence. He has contributed a long time of his career working on SQL Server and other RDBMS. If he is not busy with SQL stuff then he must be watching some Hollywood movies.

Leave a Reply

%d bloggers like this: