2010/4/5 Tanaka Akira <akr / fsij.org>: > 2010/4/5 Aaron Patterson <aaron / tenderlovemaking.com>: >> >> How should this problem be fixed? ¨Βτινε οβκεγτ χθεξ δυνπεδ ασ ΩΑΝΜ >> does not use the YAML time format, that would be surprising to me. ¨Β>> my assumption wrong? ¨Β§δ μιλε το μεαφιτ τθχαιτ χοςλξοχ® > > 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 available. > 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 -- NARUSE, Yui naruse / airemix.jp