My C++ program sets a timezone using method SetTimeZoneInformation() with values:
- StandardName = "Central Europe Standard Time"
- DaylightName = "Central Europe Daylight Time"
- Bias = -60
It can then be easily read by C++ method GetTimeZoneInformation(). Demo can be found here:
But if I try to read this information by Java using this code:
TimeZone timeZone = Calendar.getInstance().getTimeZone();
... it shows a different value:
- timeZone.getID() returns "GMT"
- timeZone.getDisplayName() returns "Greenwich Mean Time"
It seems that both methods work with different data or they interpret it differently.
The same situation occurs when I change the timezone manually using windows-ui. Even if I select timezone "Hawaii" in Windows, Java still returns "GMT", while C++ retuns correct value "Hawaiian Standard Time". List of these textual IDs can be found here.
Do you have some experiences with both languages, please? Where does C++ write the info and where does it Java read from? Can I somehow propagate the timezone from Win to Java and visa versa?