문제

I need to save timezones - along with other data - to a file and read the file from multiple platforms (Linux, WinRT, Windows Phone 8, OS X, Android, iOS). Likely languages are C++, C#, Java, and Objective-C.

Saving the timezone offset as a double is insufficient for my needs, because this loses daylight savings information, which is important. Depending on the date and the timezone, 2 am + 2 hours could be 3 am, 4 am, or 5 am.

Is there a universally supported serializable timezone format?

도움이 되었습니까?

해결책

It seems the best answer is to use IANA/Olson/TZDB time zones (which are supported on the Unix based systems), and convert them for the Windows-based platforms. 2-way conversion seems to be unreliable, so the most feasible option seems to be to replace the default datetime framework in .NET with NodaTime, as described in multiple related questions:

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top