Skip to content

Fix local time usec bug#287

Merged
composerinteralia merged 1 commit intomainfrom
fix-nanosecond-bug
Apr 1, 2026
Merged

Fix local time usec bug#287
composerinteralia merged 1 commit intomainfrom
fix-nanosecond-bug

Conversation

@composerinteralia
Copy link
Copy Markdown
Collaborator

#286 accidentally added an unnecessary / 1000, which made usec say 159 instead of 159491

@composerinteralia
Copy link
Copy Markdown
Collaborator Author

I also removed some comments from the tests that seemed a bit redundant. The comment above these tests saying that they were inspired by the Go tests seems sufficient.

Comment on lines +507 to +514
assert_kind_of Time, time
assert_equal 2020, time.year
assert_equal 5, time.month
assert_equal 25, time.day
assert_equal 23, time.hour
assert_equal 22, time.min
assert_equal 1, time.sec
assert_equal 159491, time.usec
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert_kind_of Time, time
assert_equal 2020, time.year
assert_equal 5, time.month
assert_equal 25, time.day
assert_equal 23, time.hour
assert_equal 22, time.min
assert_equal 1, time.sec
assert_equal 159491, time.usec
assert_kind_of Time, time
assert_equal "2020-05-25 23:22:01.159491", time.iso8601(6)

Might be simpler and clearer? Also is probably better to ensure we haven't confused usec with msec

@composerinteralia composerinteralia force-pushed the fix-nanosecond-bug branch 2 times, most recently from d37aa61 to bf44233 Compare April 1, 2026 14:36
#286 accidentally added
an unnecessary `/ 1000`, which made usec say `159` instead of
`159491`
@composerinteralia composerinteralia merged commit 31a58dc into main Apr 1, 2026
43 checks passed
@composerinteralia composerinteralia deleted the fix-nanosecond-bug branch April 1, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants