Get DateTime.Now for a specific TimeZone regardless of the device timezone?

后端 未结 3 1654
温柔的废话
温柔的废话 2021-02-20 07:22

I have MonoTouch app which process data from a webservice. This data contains date information which is specific to a timezone. The timezone is UTC +12 which is for New Zealand.

3条回答
  •  太阳男子
    2021-02-20 07:57

    You can do it like:

    Datetime date = TimeZoneInfo.ConvertTime(utcDateTime, timeZone); 
    

    Just pass the given parameters.

提交回复
热议问题