From: matz@... (Yukihiro Matsumoto) Date: 2004-05-14T13:39:22+09:00 Subject: Re: Bug in Marshal? Hi, In message "Bug in Marshal?" on 04/05/14, matt writes: |With the usual deep_copy: | |# Deep copy |class Object | def deep_copy | Marshal.load(Marshal.dump(self)) | end |end Marshal did not preserve gmt information. They are same time, same seconds after the Epoch. Just representation time zone is different. 1.9 will preserve this information in the near future. matz. --- time.c 30 Apr 2004 11:10:02 -0000 1.100 +++ time.c 14 May 2004 04:38:36 -0000 @@ -1904,3 +1904,4 @@ time_mdump(time) p = 0x1 << 31 | /* 1 */ - tm->tm_year << 14 | /* 17 */ + tobj->gmt << 30 | /* 1 */ + tm->tm_year << 14 | /* 16 */ tm->tm_mon << 10 | /* 4 */ @@ -1962,3 +1960,3 @@ time_mload(time, str) struct tm tm; - int i; + int i, gmt; @@ -1985,3 +1983,4 @@ time_mload(time, str) p &= ~(1<<31); - tm.tm_year = (p >> 14) & 0x1ffff; + gmt = (p >> 30) & 0x1; + tm.tm_year = (p >> 14) & 0xffff; tm.tm_mon = (p >> 10) & 0xf; @@ -2000,2 +1999,3 @@ time_mload(time, str) tobj->tm_got = 0; + tobj->gmt = gmt; tobj->tv.tv_sec = sec;