Project

General

Profile

Actions

Bug #21141

open

`Time#utc?` does not work with a timezone object

Added by nobu (Nobuyoshi Nakada) 25 days ago. Updated 25 days ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:121066]

Description

require 'timezone'
require 'tzinfo'

t = Time.now(in: "UTC")
t_timezone = Time.now(in: Timezone["UTC"])
t_tzinfo = Time.now(in: TZInfo::Timezone.get("UTC"))
p t.utc?          #=> true
p t_timezone.utc? #=> false
p t_tzinfo.utc?   #=> false

This also affects strftime("%-z").

Actions

Also available in: Atom PDF

Like0
Like0