Get timezone from DateTime

前端 未结 7 2317
Happy的楠姐
Happy的楠姐 2020-12-04 22:49

Does the .Net DateTime contain information about time zone where it was created?

I have a library parsing DateTime from a format that has \"+zz\" at the end, and wh

7条回答
  •  Happy的楠姐
    2020-12-04 23:32

    No.

    A developer is responsible for keeping track of time-zone information associated with a DateTime value via some external mechanism.

    A quote from an excellent article here. A must read for every .Net developer.

    So my advice is to write a little wrapper class that suits your needs.

提交回复
热议问题