[ruby-core:81892] [Ruby trunk Bug#13710] Time zone info lost after doing +/- on time object that loaded from dumped string.

From: cantin2010@...
Date: 2017-07-04 02:50:50 UTC
List: ruby-core #81892
Issue #13710 has been reported by Cantin (Cantin Xu).

----------------------------------------
Bug #13710: Time zone info lost after doing +/- on time object that loaded from dumped string.
https://bugs.ruby-lang.org/issues/13710

* Author: Cantin (Cantin Xu)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin15]
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
See script below.

Time#zone return nil after doing +/- on instance b (which is loaded from dumped string)

~~~
a = Marshal.dump(Time.now)
b = Marshal.load(a)
p b.zone  # CST
p (b + 1).zone # nil
p (b - 1).zone # nil
p (Time.now + 1).zone # CST
~~~



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next