-
Notifications
You must be signed in to change notification settings - Fork 110
TimeZone..of("UTC") isn't equal to TimeZone.UTC #474
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
Comments
This is a complex topic. The logic today is simple: if two identifiers are different strings, they are different time zones, even if their rules are the same. If we break this logic, it's unclear where to put the boundary and why. I agree that what you're showing is unintuitive. Yet where does the unintuitiveness stop? Is it intuitive that In the timezone database, there is a notion of timezone aliases (different names for the same thing), but the problem is, some timezones that are aliases today may well stop being equal after a political change, so even this is not correct in general: usually, we need to faithfully preserve the string passed to |
I hear you on the complexity of this topic in general, but the specific example seems fixable. Why is the identifier of |
Oh, ok, I misunderstood your question, then. So, it's okay that |
Yes, that's correct. |
It's very unintuitive that this assert fails.
I've re-discovered this fact multiple times when writing tests around datetime logic with time zones.
Presumably this is the same root cause as #222
The text was updated successfully, but these errors were encountered: