[C#]UTC時區轉換

Windows Azure時區預設為UTC世界標準時間(Coordinated Universal Time)

台北TimeZoneID: Taipei Standard Time

C#

var twtzinfo = TimeZoneInfo.FindSystemTimeZoneById("Taipei Standard Time");

DateTime localdt = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, twtzinfo);

 

TSQL(UTC+8 )

Select dateadd(hh,8,getdate());

 

參考

Microsoft Time Zone Index Values

How to Convert UTC Time to Local Time in SQL