-
Notifications
You must be signed in to change notification settings - Fork 103
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
Provide construction and/or parsing for ZoneOffset #91
Comments
It's also probably doable in common code, so implementing it once should be sufficient (although for Java you could pretty much just delegate most things) |
Hey @cromefire do you still need someone to look into this? I can work on that this week |
Yes I still think that's a good addition, because I mean if you can't parse a zone offset into a ZoneOffset that doesn't seem very intuitive, right? |
I think it makes total sense, it'll also help Java devs wanting to adopt the library. I'll work on it 👍 |
Adding a way to parse As a side note, with the latest release, it is also possible to parse a TimeZone.of("+02:00") as ZoneOffset |
In the course of
|
Currently you are not able to directly parse strings like
+02:00
into anZoneOffset
. You can do so viabut it's rather a workaround, than a real solution (and if that's important probably less performant/efficient/discoverable).
My Idea would be to provide an
ofHoursMinutes()
(and maybe alsoofHours()
,ofHoursMinutesSeconds()
andofTotalSeconds()
) function similar to Java:and a parsing function that parses the time according to RFC3339
time-numoffset
ortime-offset
(like Java'sof()
):A
ZoneOffset.UTC
would also be great.This would greatly simplify #90.
edited to adjust my ideas more towards what Java already does
The text was updated successfully, but these errors were encountered: