-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Format Time#inspect with Internet Extended Date/Time Format
#16039
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
Merged
straight-shoota
merged 13 commits into
crystal-lang:master
from
straight-shoota:feat/time.inspect-location
Sep 29, 2025
Merged
Changes from 8 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
50dfe36
Format `Time#inspect` with Internet Extended Date/Time Format
straight-shoota de3f9bc
Optimize `#inspect`
straight-shoota d473fc2
Adjust doctest values
straight-shoota 3436a2c
Adjust more doctest values and other documentation
straight-shoota f5ff656
Omit zero nanoseconds entirely
straight-shoota c45f316
Replace separator char by space for readability
straight-shoota 650635a
Add documentation
straight-shoota 8d78843
Simplify implementation with `Format::RFC_3339`
straight-shoota ec03b57
Apply suggestions from code review
straight-shoota 9ad546a
Revert unintended changes in log format
straight-shoota e42fa01
Merge branch 'master' into feat/time.inspect-location
straight-shoota b9ef13a
Adapt `Time#inspect` format
straight-shoota 15c3dc8
Merge branch 'master' into feat/time.inspect-location
straight-shoota File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought: Dropping the second fractions entirely when nanoseconds are zero might be debatable. I think it's more readable that way.
But that makes it ambiguous whether nanoseconds were entirely cut off (
with_nanoseconds: false) or are just omitted because the subsection fraction is zero. Shortening the fraction to just.0was more explicit. But I don't think it's that important.with_nanoseconds: falseis a rather odd feature. I'm not aware of any actual use case. It was introduced in #5794 but I don't recall what was the reason for it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably deprecate
with_nanoseconds.