Project

General

Profile

Bug #8454

Date and Time compatibility

Added by Jonatan Hejzlar about 3 years ago. Updated about 3 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
ruby -v:
2.0.0p195
[ruby-core:55172]

Description

Time.to_datetime creates a DateTime object with the local timezone
Date.to_datetime creates a DateTime object with the +0000 timezone

As a result, Date.to_time.to_datetime gives a different result than Date.to_datetime.

History

#1 [ruby-core:55178] Updated by tadayoshi funaba about 3 years ago

  • Status changed from Open to Rejected

it's the current spec.
see .

i think you are interested in the following case too.

Time.parse('2001-02-03')
#=> 2001-02-03 00:00:00 +0900

Date.parse('2001-02-03')
#=> #

DateTime.parse('2001-02-03')
#=> #

i honestly don't like this feature.
but i think i just provided what users want in this case.

Also available in: Atom PDF