DateTimeToUnix in UTC?

后端 未结 2 1921
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-03 02:25

I need UTC variants of the functions DateTimeToUnix and UnixToDateTime, so a Chinese customer is able to interact with the server in Germany. Both

2条回答
  •  情深已故
    2021-01-03 03:01

    You have already found DateTimeToUnix and UnixToDateTime. So that part of the conversion is taken care of.

    All you need to do now is convert between local and UTC time. You can do that using DateUtils.TTimeZone class. Specifically DateUtils.TTimeZone.ToUniversalTime and DateUtils.TTimeZone.ToLocalTime.

    These four functions give you all that you need.

提交回复
热议问题