Skip to content

Commit

Permalink
Add microsecond precision to System::File.utime (Unix) (#7156)
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota authored and RX14 committed Dec 7, 2018
1 parent 24f545a commit 1154cb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/crystal/system/unix/file.cr
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ module Crystal::System::File
private def self.to_timeval(time : ::Time)
t = uninitialized LibC::Timeval
t.tv_sec = typeof(t.tv_sec).new(time.to_unix)
t.tv_usec = typeof(t.tv_usec).new(0)
t.tv_usec = typeof(t.tv_usec).new(time.nanosecond / ::Time::NANOSECONDS_PER_MICROSECOND)
t
end

Expand Down

0 comments on commit 1154cb8

Please sign in to comment.