[#82706] [Ruby trunk Bug#13851] getting "can't modify string; temporarily locked" on non-frozen instances — cardoso_tiago@...
Issue #13851 has been updated by chucke (Tiago Cardoso).
3 messages
2017/09/07
[#82853] [Ruby trunk Bug#13916] Race condition when sending a signal to a new fork — russell.davis@...
Issue #13916 has been reported by russelldavis (Russell Davis).
3 messages
2017/09/19
[#82892] [Ruby trunk Bug#13921] buffered read_nonblock doesn't work as expected using SSLSocket — cardoso_tiago@...
Issue #13921 has been updated by chucke (Tiago Cardoso).
3 messages
2017/09/20
[ruby-core:82889] [Ruby trunk Feature#13919] Add a new method to create Time instances from unix time and nsec
From:
tagomoris@...
Date:
2017-09-20 06:50:19 UTC
List:
ruby-core #82889
Issue #13919 has been updated by tagomoris (Satoshi TAGOMORI). `Time.at_nsec` is ok for me, but it seems to take just one argument of nano seconds from epoch. * `Time.at_nsec(nsec_from_epoch)` * `Time.at_nsec(seconds_from_epoch, nsec)` Is it not confusing? Or should it get exactly two arguments? ---------------------------------------- Feature #13919: Add a new method to create Time instances from unix time and nsec https://bugs.ruby-lang.org/issues/13919#change-66788 * Author: tagomoris (Satoshi TAGOMORI) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- Time object contains `nsec`, but Time class doesn't have method to create an instance with nsec. Time.at() accepts 2nd argument, but it's micro-sec, and we need to divide nsec by 1000.0. ```ruby t1 = Time.now t1.nsec #=> nsec value t2 = Time.at(t1.to_i, t1.usec) # not nsec! t3 = Time.at(t1.to_i, t1.nsec / 1000.0) # additional division ``` I think it's better to have another method to create an instance from time(unix time) and nsec, for example, `Time.of(unix_time, nsec)` ```ruby t = Time.now Time.of(t.to_i, t.nsec) == t ``` -- https://bugs.ruby-lang.org/ Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>