Skip to content
Advertisement

SQL Server 2008 – How to convert GMT(UTC) datetime to local datetime?

I have an insert proc that passes in GETDATE() as one of the values because each insert also stores when it was inserted. This is hosted on SQL Azure – which uses GMT.

Now, when I am receiving messages, I have the GMT date stored for each of them in their timestamp columns, how do I convert this to the local datetime for wherever you are when you are accessing my page?

Thanks.

Advertisement

Answer

You could do something like this:

or

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement