-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Time parse error in master #6093
Comments
i find that now need to set location:
why not set it by default? |
Because the correct default massively depends on usecase. |
Well the local default seems easier and makes sense in most cases.
with output:
With the default suggested the code would be (basically if the user is concerned with timezones he'll add the argument, if not the sane/default is fine, being local time):
So for me also +1 for the defaulting to local time. If you want UTC or something else you can always give it. Also to drive it further down to having defaults. The documentation on the crystal lang site is not updated and does say you have to give a time location as being local for .parse to work: https://crystal-lang.org/api/0.20.0/Time.html Other than that, keep up the great work! |
There's also |
@w-A-L-L-e Seems you've been looking at outdated docs from 0.20.0 judging by the links you posted. The most recent API documentation is here: https://crystal-lang.org/api/latest/Time.html There is now |
Thanks, parse_local and parse_utc work indeed for a short/concise way of creating times... great ;). |
this works in 0.24.2 and not work in master:
The text was updated successfully, but these errors were encountered: