Project

General

Profile

Actions

Bug #15439

closed

Time object's zone generated by Time.getlocal returns a strange value

Added by y-yagi (Yuji Yaginuma) over 5 years ago. Updated over 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.6.0dev (2018-12-17 trunk 66427) [x86_64-linux]
[ruby-core:90627]

Description

Time object's zone generated by Time.getlocal returns a strange value in Ruby 2.6

$ ruby -v -e 'p Time.new.utc.getlocal(0).zone; p Time.new.utc.getlocal(0).utc?
ruby 2.6.0dev (2018-12-17 trunk 66427) [x86_64-linux]
"UTC"
false 

Since utc? is false, I think that it is wrong that the zone becomes "UTC", what about it?

Nil was returning until Ruby 2.5.

ruby -v -e 'p Time.new.utc.getlocal(0).zone; p Time.new.utc.getlocal(0).utc?'
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
nil
false 
Actions

Also available in: Atom PDF

Like0
Like0Like0