sql server convert datetime into another timezone?

后端 未结 3 880
日久生厌
日久生厌 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:19

     select CONVERT(datetime,SWITCHOFFSET(CONVERT(datetimeoffset,GetUTCDate()),'+05:30')) Date_India,
    
     select CONVERT(datetime,SWITCHOFFSET(CONVERT(datetimeoffset,GetUTCDate()),'+03:30')) Date_Iran
    

    check here

提交回复
热议问题