Project

General

Profile

Actions

Bug #6887

closed

Time.zone.now returning different timezone that Time.zone.at

Added by anthfb (Anthony Figueroa) over 11 years ago. Updated over 11 years ago.

Status:
Third Party's Issue
Assignee:
-
Target version:
ruby -v:
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]
Backport:
[ruby-core:47233]

Description

1.9.2p290 :018 > Time.zone = 'Brasilia'
=> "Brasilia"

1.9.2p290 :020 > Time.zone.now
=> Fri, 17 Aug 2012 13:08:06 BRT -03:00

1.9.2p290 :021 > Event.last.start_time
=> 2000-01-01 03:45:00 UTC

1.9.2p290 :022 > Time.zone.at(event.start_time)
=> Sat, 01 Jan 2000 01:45:00 BRST -02:00

Why is this happening? Is it a bug?

Updated by drbrain (Eric Hodel) over 11 years ago

  • Status changed from Open to Rejected

Brazil uses daylight savings time. Jan 1 is in standard time, Aug 17th is in daylight savings time:

http://www.timeanddate.com/worldclock/timezone.html?n=45

Actions #2

Updated by drbrain (Eric Hodel) over 11 years ago

Oops, I got the direction backwards, but the behavior is still expected.

Updated by nobu (Nobuyoshi Nakada) over 11 years ago

  • Status changed from Rejected to Third Party's Issue

=begin
No such methods, (({Time#zone})) and (({Time#zone=})), are defined.
Probably ActiveSupport or similar gems.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0