Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

[PATCH] to_utc_offset_s misbehaviour if hour is < 0

#3741

For example, this works as expected:

-3600.to_utc_offset_s #Returns "-01:00"

But this don't:

-3599.to_utc_offset_s #Returns "+00:59", should be "-00:59"

Reported by Mauricio Eduardo Szabo · January 18th, 2010 @ 05:09 PM

State: committed
Milestone: none
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. Prem Sichanugrist (sikachu)
    Prem Sichanugrist (sikachu)
    • Tag set to 2-3-stable, 2.3.6, 2.3.x, active_support, core_ext

    This is affected to Rails 2.3.x only.

    This method is deprecated in Rails 3, and replaced with ActiveSupport::TimeZone.seconds_to_utc_offset, which already resolved this problem.

    Will try to see if I can patch 2-3-stable based on Rails 3's implementation.

    January 18th, 2010 @ 06:22 PM

  2. Prem Sichanugrist (sikachu)
    Prem Sichanugrist (sikachu)

    Oh wait, ActiveSupport::TimeZone also has a bug.

    irb(main):027:0> ActiveSupport::TimeZone.seconds_to_utc_offset -3599
    => "-01:59"
    

    It should be "-00:59". Will look into it.

    January 18th, 2010 @ 06:35 PM

  3. Prem Sichanugrist (sikachu)
    Prem Sichanugrist (sikachu)
    • Tag changed from 2-3-stable, 2.3.6, 2.3.x, active_support, core_ext to 2-3-stable, 2.3.6, 2.3.x, active_support, core_ext, patch, review
    • Title changed from to_utc_offset_s misbehaviour if hour is < 0 to [patch] to_utc_offset_s misbehaviour if hour is < 0

    Here are patches for 2-3-stable and master

    January 18th, 2010 @ 06:59 PM

  4. Prem Sichanugrist (sikachu)
    Prem Sichanugrist (sikachu)
    • Tag changed from 2-3-stable, 2.3.6, 2.3.x, active_support, core_ext, patch, review to 2-3-stable, 2.3.6, 2.3.x, active_support, bugmash, core_ext, patch, review
    • Title changed from [patch] to_utc_offset_s misbehaviour if hour is < 0 to [PATCH] to_utc_offset_s misbehaviour if hour is < 0

    January 18th, 2010 @ 07:02 PM

  5. Repository
  6. Repository
    Repository

    (from [6e62e89737c991de712a13b67a282ce599710ec9]) Fix bug that causes TimeZone.seconds_to_utc_offset to returns wrong offset when hour < 0 and not in hundreds [#3741 [PATCH] to_utc_offset_s misbehaviour if hour is < 0 status:resolved]

    Signed-off-by: José Valim jose.valim@gmail.com
    http://github.com/rails/rails/commit/6e62e89737c991de712a13b67a282c...

    January 19th, 2010 @ 07:38 PM

  7. José Valim
    José Valim
    • State changed from new to committed
    • Assigned user set to José Valim

    January 19th, 2010 @ 07:39 PM