sql server convert datetime into another timezone?

后端 未结 3 859
日久生厌
日久生厌 2020-12-10 21:58

How do I convert the current time (datetime) in my timezone into another timezone, say France ? I looked around in SO, but did not find any posts which could help me. I am u

3条回答
  •  攒了一身酷
    2020-12-10 22:30

    I also agree the correct SQL Query is using GetUTCDate() as you see in the screenshot.

    select CONVERT(datetime,SWITCHOFFSET(CONVERT(datetimeoffset,GetUTCDate()),'+05:30')) Date_India_withUtcDate
    

提交回复
热议问题