.NET converting datetime to UTC given the timezone

前端 未结 3 1709
南旧
南旧 2021-01-17 11:25

Using C#, I need to convert incoming datetime values into UTC. I know there is functionality in .NET for these conversions but all I have to identify the timezone is the sta

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-17 12:05

    There is a lot of information on MSDN about converting to different time zones.

    • DateTime (MSDN), specifically look at 'DateTime Operations'.
    • TimeZoneInfo

    You probably want to use ConvertTimeBySystemTimeZoneId method (follow link for examples).

提交回复
热议问题