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
timeZoneName is unabbreviated on Windows #17085
Comments
Added Area-Library, Triaged labels. |
Removed Area-Library label. |
This comment was originally written by @marcojakob Any news on this? Do we have a workaround? I have the same problem with Central European (Summer) Time: Expected Output: CET, CEST, MET, or MEST But output was: Mitteleurop\u0000!®\u0000\u0000!®\u0000\u0000!®\u0000\u0000!®\u0000\u0000 Dart VM version: 1.7.0.dev_03_00 (2014-09-16) Windows 8 - amd64 (6.2) |
This comment was originally written by @Fox32 Run into the same problem as #4 today. The null characters seems to be related to german window. |
I have same issue, is there a solution for this already implemented or way around ? |
Sorry for taking so long to look at this. Looking at the implementation, there are a couple problems. First and foremost, Windows does not provide time zone abbreviations. Rather, it provides whatever string is in the system registry at: HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Windows NT > CurrentVersion > Time Zones The second problem is the bug reported by @marcojakob. In this case we are failing to correctly convert the string provided by Windows. The first problem should probably be solved by a Dart code library wrapping DateTime. I'm working on updating the documentation for DateTime.timeZoneName, and fixing the conversion problem here: |
This issue was originally filed by @wskb
What steps will reproduce the problem?
Sample program:
int main() {
print(new DateTime.now().timeZoneName);
}
What is the expected output?
MST
(This is based on the documentation for timeZoneName, which describes its value as """The abbreviated time zone name—for example, "CET" or "CEST".""")
What do you see instead?
Mountain Standard Time
What version of the product are you using? On what operating system?
Dart VM version: 1.1.3 (Thu Feb 06 00:06:36 2014) on "windows_ia32"
The text was updated successfully, but these errors were encountered: