From: Aaron Patterson Date: 2010-04-05T10:04:47+09:00 Subject: [ruby-core:29251] Re: [Bug #3085] Time dumping/loading using Psych --gKMricLos+KVdGMg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 04, 2010 at 11:35:24AM +0900, Tanaka Akira wrote: > 2010/4/4 Aaron Patterson : > > > > hmmm. Is this necessary? You can dump your time object as a rational = if you need that kind of accuracy: >=20 > Don't do it. The interpretation of "seconds from Unix epoch" depends on > timezone because timezone contains leapsecond information. >=20 > % TZ=3DAmerica/New_York ./ruby -rpsych -e ' > t =3D Time.local(2010,1,1) > STDERR.puts t > Psych.dump(t.to_r, STDOUT)' > z > 2010-01-01 00:00:00 -0500 > % TZ=3Dright/America/New_York ./ruby -rpsych -e 'p Time.at(Psych.load(STD= IN))' < z > 2009-12-31 23:59:36 -0500 >=20 > The result of Time#to_r is intepreted differently with timezone. >=20 > Even if same timezone is used, leapseconds information will be updated > when new leapseconds is determined. How should this problem be fixed? If a time object when dumped as YAML does not use the YAML time format, that would be surprising to me. Is my assumption wrong? I'd like to leave it the way it works now. --=20 Aaron Patterson http://tenderlovemaking.com/ --gKMricLos+KVdGMg Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (Darwin) iQEcBAEBAgAGBQJLuTcrAAoJEJUxcLy0/6/GTXcH/i86CGi5jqW2HUdrZMZTCCUb qUfjXbqzNi7HvEl8DUBQPMjCDnLdgeo9kMUYeU9wrkZye2Y3MPRgV3YaMt8e4RCM LuXrT6ZtB32WfRQXmxPztZLNbIB+AAwnZTxVlYNqa2RlIAxTYKCRgCUDkXo7dgsW tfsQ4t3ZYfO3uAzWmi0PFBYJ+SdkuFMDzvgtMyBh6EywbUs3GXGcK1HCRBuJuO10 JyRQCEQlbgu8rphYKNXx5Nv6NL7LXsK+wHCpmov9qGD17EDymf2ybIJE4eR1RA+H nkZKdJEcuCOi01CvR6QpJVb7suX3PhyWcKkCoYoPEgx96BwHheWTtd+QJ4kX4QM= =o8YR -----END PGP SIGNATURE----- --gKMricLos+KVdGMg--