OS.get_time_zone_info returning different bias on different platforms?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Kingdombit

Using Godot 3.0.x, when I call OS.get_time_zone_info from Windows 10, I’m getting the exact opposite bias (positive/negative) as I am when calling it from Android (running Android 7.1.2 / Xiaomi MIUI Global 9.6).

For example: if the timezone is +8 for both devices, Windows will return a bias of -480 and Android will return 480.

I’ve noticed it doesn’t matter what timezone the devices are set for either device, Windows will return negative a bias if the timezone is UTC+ and a positive bias if it is UTC-. And the exact opposite for my Android.

So, a couple questions if anyone is able to help me, even in part:

1. Is this a bug with OS.get_time_zone_info on certain platforms, perhaps? Or is one of my devices returning incorrect timezone information?

2. Which bias is the correction/intend offset? (Should UTC+ timezone return a positive bias or a negative bias, etc?)

Thanks for any help with this at all. Even knowing what the intended bias is for time zones will be enough to keep going forward with development while everything else gets sorted out. Very much appreciated! :slight_smile:

:bust_in_silhouette: Reply From: jpate

Probably this

# Get time zone info with a bug fix for windows time zone issues.
func get_time_zone_info_fixed() -> Dictionary:
	var result = OS.get_time_zone_info()
	if OS.get_name() == "Windows":
		var output = []
		OS.execute('WMIC.exe', ["OS","Get","CurrentTimeZone"],true, output)
		var bias = int(output[0].split("\n")[1])
		result.bias = bias
	return result