Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TimeZone.getTimeZone(null) returns null #2610

Open
XG-Taiwan opened this issue Apr 18, 2023 · 4 comments
Open

TimeZone.getTimeZone(null) returns null #2610

XG-Taiwan opened this issue Apr 18, 2023 · 4 comments
Labels

Comments

@XG-Taiwan
Copy link

Problem Description

A TimeZone.getTimeZone(null) call returns null instead of a TimeZone object representing the current location of the device, as it is stated within the ASDocs: "Pass in a null string to get the TimeZone object representing the current location of the device."

  • AIR SDK: 50.2.2.4
  • Flex SDK: 4.16
  • Affected environment: Win 11 (didn't test it on other Platforms / Devices yet)

Steps to Reproduce

Example:

var timeZone:TimeZone = TimeZone.getTimeZone(null);
trace(timeZone); // null
@XG-Taiwan XG-Taiwan added the Bug label Apr 18, 2023
@itlancer
Copy link

Issue still exists with AIR 51.0.0.2 for Windows. May be some locale-specific comparison under the hood...
There is no such issue for Android.

@ajwfrost
Copy link
Collaborator

This is one of those "works for us" things....

For that scenario to return a null timezone on Windows, then either:

  1. The kernel32.dll library does not contain a function called GetDynamicTimeZoneInformation
  2. Or, that function call (passing the address of a blank DYNAMIC_TIME_ZONE_INFORMATION structure) is returning false.

Ah .. so, re-reading the documentation for it, maybe the function would return false if you are in a locale that does not support 'dynamic' time zones i.e. daylight saving. So actually, if that function fails, we can instead call GetTimeZoneInformation and populate things appropriately...

thanks

@itlancer
Copy link

itlancer commented Mar 2, 2024

@ajwfrost
Issue still exists with AIR 51.0.0.3 for Windows.
For example try with time zone (execute via CMD):
tzutil /s "Turkey Standard Time"

@itlancer
Copy link

itlancer commented Apr 2, 2024

@ajwfrost
Issue still exists using AIR 50.2.4.5 for Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants