Project

General

Profile

Bug #12189

DateTime#to_time removes timezone information

Added by sonots (Naotoshi Seo) over 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin13]
[ruby-dev:49521]

Description

irb(main):004:0> DateTime.strptime('2015-11-12 CET', '%Y-%m-%d %Z')
=> #<DateTime: 2015-11-12T00:00:00+01:00 ((2457338j,82800s,0n),+3600s,2299161j)>
irb(main):005:0> DateTime.strptime('2015-11-12 CET', '%Y-%m-%d %Z').to_time
=> 2015-11-12 08:00:00 +0900

I think it is better to preserve timezone information as 2015-11-12 00:00:00 +0100

Associated revisions

Revision 5f11a6eb
Added by sonots (Naotoshi Seo) over 2 years ago

  • ext/date/date_core.c (datetime_to_time): preserve timezone info [Bug #12189] [Fix GH-1295]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 54169
Added by sonots (Naotoshi Seo) over 2 years ago

  • ext/date/date_core.c (datetime_to_time): preserve timezone info [Bug #12189] [Fix GH-1295]

Revision 54169
Added by sonots (Naotoshi Seo) over 2 years ago

  • ext/date/date_core.c (datetime_to_time): preserve timezone info [Bug #12189] [Fix GH-1295]

Revision 54169
Added by sonots (Naotoshi Seo) over 2 years ago

  • ext/date/date_core.c (datetime_to_time): preserve timezone info [Bug #12189] [Fix GH-1295]

Revision 59fadede
Added by usa (Usaku NAKAMURA) about 2 years ago

merge revision(s) 54169: [Backport #12189]

* ext/date/date_core.c (datetime_to_time): preserve timezone info
  [Bug #12189] [Fix GH-1295]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@54694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 54694
Added by usa (Usaku NAKAMURA) about 2 years ago

merge revision(s) 54169: [Backport #12189]

* ext/date/date_core.c (datetime_to_time): preserve timezone info
  [Bug #12189] [Fix GH-1295]

Revision e9db63d9
Added by yui-knk (Kaneko Yuichiro) about 2 years ago

  • NEWS: Add descriptions for DateTime#to_time updates. [Bug #12189] [ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 54724
Added by yui-knk (Kaneko Yuichiro) about 2 years ago

  • NEWS: Add descriptions for DateTime#to_time updates. [Bug #12189] [ci skip]

Revision 54724
Added by yui-knk (Kaneko Yuichiro) about 2 years ago

  • NEWS: Add descriptions for DateTime#to_time updates. [Bug #12189] [ci skip]

Revision 54724
Added by yui-knk (Kaneko Yuichiro) about 2 years ago

  • NEWS: Add descriptions for DateTime#to_time updates. [Bug #12189] [ci skip]

History

#2 Updated by sonots (Naotoshi Seo) over 2 years ago

  • Status changed from Open to Closed

Applied in changeset r54169.


  • ext/date/date_core.c (datetime_to_time): preserve timezone info [Bug #12189] [Fix GH-1295]

#3 [ruby-dev:49588] Updated by usa (Usaku NAKAMURA) about 2 years ago

  • Backport changed from 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.1: WONTFIX, 2.2: REQUIRED, 2.3: REQUIRED

#4 [ruby-dev:49590] Updated by usa (Usaku NAKAMURA) about 2 years ago

  • Backport changed from 2.1: WONTFIX, 2.2: REQUIRED, 2.3: REQUIRED to 2.1: WONTFIX, 2.2: DONE, 2.3: REQUIRED

ruby_2_2 r54694 merged revision(s) 54169.

#5 [ruby-dev:49591] Updated by usa (Usaku NAKAMURA) about 2 years ago

  • Backport changed from 2.1: WONTFIX, 2.2: DONE, 2.3: REQUIRED to 2.1: WONTFIX, 2.2: WONTFIX, 2.3: UNKNOWN

#6 [ruby-dev:49593] Updated by nagachika (Tomoyuki Chikanaga) about 2 years ago

  • Backport changed from 2.1: WONTFIX, 2.2: WONTFIX, 2.3: UNKNOWN to 2.1: WONTFIX, 2.2: WONTFIX, 2.3: WONTFIX

Also available in: Atom PDF