This project is archived and is in readonly mode.
[PATCH] to_utc_offset_s misbehaviour if hour is < 0
Reported by Mauricio Eduardo Szabo | January 18th, 2010 @ 05:09 PM
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"
Comments and changes to this ticket
-
Prem Sichanugrist (sikachu) January 18th, 2010 @ 06:22 PM
- 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.
-
Prem Sichanugrist (sikachu) January 18th, 2010 @ 06:35 PM
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.
-
Prem Sichanugrist (sikachu) January 18th, 2010 @ 06:59 PM
- 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
andmaster
-
Prem Sichanugrist (sikachu) January 18th, 2010 @ 07:02 PM
- 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
-
Repository January 19th, 2010 @ 07:37 PM
(from [ef10988fdd2fa2dfb92fa731b139cadb32e9811a]) Fix bug that causes to_utf_offset_s to returns wrong offset when hour < 0 and not in hundreds [#3741 status:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/ef10988fdd2fa2dfb92fa731b139ca... -
Repository January 19th, 2010 @ 07:38 PM
(from [6e62e89737c991de712a13b67a282ce599710ec9]) Fix bug that causes TimeZone.seconds_to_utc_offset to returns wrong offset when hour < 0 and not in hundreds [#3741 status:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/6e62e89737c991de712a13b67a282c... -
José Valim January 19th, 2010 @ 07:39 PM
- State changed from new to committed
- Assigned user set to José Valim
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 3741 [PATCH] to_utc_offset_s misbehaviour if hour is < 0 (from [ef10988fdd2fa2dfb92fa731b139cadb32e9811a]) Fix bug...
- 3741 [PATCH] to_utc_offset_s misbehaviour if hour is < 0 (from [6e62e89737c991de712a13b67a282ce599710ec9]) Fix bug...