How do you convert date to UTC?

Hoàng Minh An

New member
How do you convert date to UTC?
Answer
The
ToUniversalTime method converts a DateTime value from local time to UTC. To convert the time in a non-local time zone to UTC, use the TimeZoneInfo. ConvertTimeToUtc(DateTime, TimeZoneInfo) method. To convert a time whose offset from UTC is known, use the ToUniversalTime method.
 

Tìm kiếm

Back
Top