Actions
Feature #3085
closedTime dumping/loading using Psych
Feature #3085:
Time dumping/loading using Psych
Description
=begin
Due to the precision of timestamp that Psych dumps, dumped time loaded
by Psych is not always identical to the original time.
require 'psych'
time = Time.at(Time.now.sec)
p time == (Psych.load Psych.dump time) #=> true
time = Time.now
p time == (Psych.load Psych.dump time) #=> false (in my environment)
time = Time.at(Time.now.sec, Rational(1, 3))
p time == (Psych.load Psych.dump time) #=> false
According to the YAML timestamp specification [http://yaml.org/type/timestamp.html],
the standard format cannot represent time in rational.
Thus, to fully express Ruby's Time object, we have to use a format
other than the standard YAML timestamp.
=end
Actions