[ruby-core:74845] [Ruby trunk Bug#12259] DateTime.parse does not take into account system time

From: sonots@...
Date: 2016-04-07 15:57:42 UTC
List: ruby-core #74845
Issue #12259 has been reported by Naotoshi Seo.

----------------------------------------
Bug #12259: DateTime.parse does not take into account system time
https://bugs.ruby-lang.org/issues/12259

* Author: Naotoshi Seo
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin13]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
DateTime.parse does not take into account the system timezone although Time.parse does take into account the system timezone.

```
irb(main):002:0> DateTime.parse('2011-10-10 10:00:00')
=> #<DateTime: 2011-10-10T10:00:00+00:00 ((2455845j,36000s,0n),+0s,2299161j)>
irb(main):005:0> Time.parse('2011-10-10 10:00:00')
=> 2011-10-10 10:00:00 +0900
```

Are there any reasons that `DateTime.parse` behaves like this?
Can this behavior  be changed, or do we have to keep this behavior for lower version compatibility?



-- 
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