sql server 将日期时间转换为另一个时区?

问题描述:

如何将我所在时区的当前时间(日期时间)转换为另一个时区,比如法国?我环顾四周,但没有找到任何可以帮助我的帖子.我使用的是 SQL Server 2008.

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 using SQL server 2008.

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

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

在这里查看