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

timeZoneName is unabbreviated on Windows #17085

Closed
DartBot opened this issue Feb 24, 2014 · 7 comments
Closed

timeZoneName is unabbreviated on Windows #17085

DartBot opened this issue Feb 24, 2014 · 7 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. os-windows type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@DartBot
Copy link

DartBot commented Feb 24, 2014

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"

@sethladd
Copy link
Contributor

Added Area-Library, Triaged labels.

@lrhn
Copy link
Member

lrhn commented Feb 26, 2014

Removed Area-Library label.
Added Area-VM, OpSys-Windows labels.

@iposva-google
Copy link
Contributor

Set owner to @zanderso.
Added Accepted label.

@DartBot
Copy link
Author

DartBot commented Sep 29, 2014

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)

@DartBot
Copy link
Author

DartBot commented Nov 11, 2014

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.

@DartBot DartBot added Type-Defect area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. os-windows labels Nov 11, 2014
@kevmoo kevmoo added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed priority-unassigned labels Feb 29, 2016
@jpate13
Copy link

jpate13 commented Jun 14, 2016

I have same issue, is there a solution for this already implemented or way around ?

@zanderso
Copy link
Member

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:

https://codereview.chromium.org/2069783002/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. os-windows type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

7 participants