2010/4/5 Tanaka Akira <akr / fsij.org>:
> 2010/4/5 Aaron Patterson <aaron / tenderlovemaking.com>:
>>
>> How should this problem be fixed? =A0If a time object when dumped as YAM=
L
>> does not use the YAML time format, that would be surprising to me. =A0Is
>> my assumption wrong? =A0I'd like to leave it the way it works now.
>
> If the fractional seconds are representable in the decimal system,
> it should be representable in the YAML time format.
>
> For example, Ruby obtains the current time using clock_gettime if availab=
le.
> clock_gettime returns struct timespec which has nano-second resolution.
> It needs 9 digits to preserve the information.
> But psych dumps only 6 digits.
> This is why Psych.load(Psych.dump(Time.now)) doesn't round trip.
>
> FreeBSD has bintime which is 2**(-64) second resolution.
> It is also representable in the decimal system.
> (It may need 64 digits, though.)
> Ruby generates such time in Socket::AncillaryData#timestamp.

YAML's timestamp (ISO 8601)'s fraction can have non-limited digits.
http://yaml.org/type/timestamp.html

--=20
NARUSE, Yui
naruse / airemix.jp