Project

General

Profile

Feature #13822

Time.dst_changes(t=Time.now.year)

Added by opti (Andreas Opti) about 2 years ago. Updated 8 months ago.

Status:
Feedback
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:82405]

Description

output [time1,time2] of daysaving-changes of given year

I assume the result does not depend on timezone,
only the output will be in default timezone.

History

Updated by nobu (Nobuyoshi Nakada) about 2 years ago

  • Status changed from Open to Feedback

What are time1 and time2?
If time1 is the time when DST starts at and time2 is the time when it ends at, then time1 >time2` in the Southern Hemisphere?
And what will return in non-DST timezones?

Updated by naruse (Yui NARUSE) almost 2 years ago

Usually Ruby itself doesn't have such information by itself.
It just calls localtime(3).

If you want to have information related timezone database, you should use tzinfo.gem.
https://rubygems.org/gems/tzinfo

Updated by kronikus (ANDREY KIM) 8 months ago

  • Backport set to 2.4: UNKNOWN, 2.5: UNKNOWN
  • ruby -v set to ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-linux]
  • Subject changed from Time.dst_changes(t=Time.now.year) to Time.dst?
  • Tracker changed from Feature to Bug

Is it bug or feature?
Receiving same result for Time.dst? method.
I belive it suppose to base it response on date in variable, correct me if i'm wrong.
Receiving it in Rails 5.1.2, but Time class is in ruby core

gems tzinfo, tzinfo-data are in Gemfile

Time zone configured in rails config:
2.4.3 :001 > Time.zone
=> #>

2.4.3 :013 > t
=> 2018-12-12 10:00:00 -0500
2.4.3 :014 > a
=> 2018-08-01 10:00:00 -0500
2.4.3 :015 > t.dst?
=> false
2.4.3 :016 > a.dst?
=> false
2.4.3 :017 > t.isdst
=> false
2.4.3 :018 > a.isdst
=> false

Updated by shyouhei (Shyouhei Urabe) 8 months ago

  • Backport deleted (2.4: UNKNOWN, 2.5: UNKNOWN)
  • ruby -v deleted (ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-linux])
  • Subject changed from Time.dst? to Time.dst_changes(t=Time.now.year)
  • Tracker changed from Bug to Feature

Be advised: Please do not reuse existing tickets to report something completely different.

Also be advised: please do understand that this is not where ActiveSupport::TimeZone issue should be reported.

Also available in: Atom PDF