drtimcooper / LatLongToTimezone

Lat/long to timezone mapper in Java. Does not require web services or data files - just pure Java or Swift.
MIT License
167 stars 33 forks source link

Incorrect Time Zone for Chicago #2

Closed LordNacho closed 4 years ago

LordNacho commented 8 years ago

Hi,

I ran the code with this coordinate:

latitude: 41.8788764, longitude: -87.6359149 (Willis Tower)

And it gave me America/Detroit, which is wrong. I tried a few other Chicago landmarks and they're wrong as well.

ttddlplp commented 8 years ago

Hi, I tried it on my machine, and it does return 'America/Chicago'

LordNacho commented 8 years ago

Is there anything locale specific in the code? It's quite strange that we get different results.

ttddlplp commented 8 years ago

BTW, I am using the Java library.

LordNacho commented 8 years ago

I was using Swift

2ndCharter commented 8 years ago

Are you still seeing this issue? I ported Dr. Cooper's Java version to C# for Xamarin, which runs on iOS like the Swift version. I'm getting America/Chicago for those coordinates as well.

joshorr commented 8 years ago

I am seeing the issue too with the swift version.

bjhomer commented 8 years ago

I just re-ran the Java & Swift generators, based on the timezones.json file in this repository. After regenerating the Java source, it too now fails on Chicago coordinates.

LordNacho commented 8 years ago

Did the descriptor file change at some point? It sounds like it used to be right.

drtimcooper commented 8 years ago

I believe I fixed the bug. The generator was being non-deterministic when generating code, due to my use of Set<>. That's fixed, and also Chicago is now showing as America/Chicago. I didn't find any root cause of the bug, but I've tried endlessly to randomise the generation process and I can't get Chicago to be in Detroit anymore, since I removed the Set<>'s. I am having trouble releasing the CSharp version though...not being familiar with git...I've got the latest csharp version in a folder called "Tester/src"....maybe someone can help me.