0

Hi I have column having datetime in (2017-11-15 13:01:50.397). I want to convert this UTC datetime to GMT time format.

Is there any query to convert or what i have to add or subtract number so that it will show in GMT datetime format

Sanjiv
  • 980
  • 2
  • 11
  • 29
  • Can you elaborate on your requirement? A typical pattern followed is to store _all_ your timestamps in the same timezone, e.g. GMT time. Then, it is up to the consumer to know how to offset those timestamps. – Tim Biegeleisen Sep 26 '18 at 05:51
  • What is the difference between GMT and UTC. My understanding is that they are the same. – Habeeb Sep 26 '18 at 05:53
  • Possible duplicate of [Convert Datetime column from UTC to local time in select statement](https://stackoverflow.com/questions/8038744/convert-datetime-column-from-utc-to-local-time-in-select-statement) – Jayasurya Satheesh Sep 26 '18 at 05:57

1 Answers1

1

you can try below way

 declare @InputUtcDateTime datetime = '2017-11-15 13:01:50.397'

   select @InputUtcDateTime - getutcdate() + getdate()
Zaynul Abadin Tuhin
  • 31,407
  • 5
  • 33
  • 63