irb(main):004:0> Time.local(2002, 10, 27)
Sun Oct 27 00:00:00 EDT 2002
irb(main):005:0> Time.local(2002, 10, 27) + 86400
Sun Oct 27 23:00:00 EST 2002
So, adding the amount of seconds to equal one day to 10/27/2002 only
brings it up to 23:00. If this is something completely obvious, please
enlighten me. It’s causing quite a stir in my program…
irb(main):004:0> Time.local(2002, 10, 27)
Sun Oct 27 00:00:00 EDT 2002
irb(main):005:0> Time.local(2002, 10, 27) + 86400
Sun Oct 27 23:00:00 EST 2002
Note the difference in type of time returned: EDT vs. EST
The first is Eastern Daylight (savings) Time, the second is Eastern Standard
Time, that should explain the difference of 1 hour.
But it’s strange of course, it should return the same types regardless.
I’m manipulating some dates, and I just found something weird.
[snip]
and even weirder :
~ > irb
irb(main):001:0> t = Time.local(2002, 10, 27)
Sun Oct 27 00:00:00 MDT 2002
irb(main):002:0> 24.times do |h|
irb(main):003:1* p t + 3600 * h
irb(main):004:1> end
Sun Oct 27 00:00:00 MDT 2002
Sun Oct 27 01:00:00 MDT 2002
Sun Oct 27 01:00:00 MST 2002
Sun Oct 27 02:00:00 MST 2002
Sun Oct 27 03:00:00 MST 2002
Sun Oct 27 04:00:00 MST 2002
Sun Oct 27 05:00:00 MST 2002
Sun Oct 27 06:00:00 MST 2002
Sun Oct 27 07:00:00 MST 2002
Sun Oct 27 08:00:00 MST 2002
Sun Oct 27 09:00:00 MST 2002
Sun Oct 27 10:00:00 MST 2002
Sun Oct 27 11:00:00 MST 2002
Sun Oct 27 12:00:00 MST 2002
Sun Oct 27 13:00:00 MST 2002
Sun Oct 27 14:00:00 MST 2002
Sun Oct 27 15:00:00 MST 2002
Sun Oct 27 16:00:00 MST 2002
Sun Oct 27 17:00:00 MST 2002
Sun Oct 27 18:00:00 MST 2002
Sun Oct 27 19:00:00 MST 2002
Sun Oct 27 20:00:00 MST 2002
Sun Oct 27 21:00:00 MST 2002
Sun Oct 27 22:00:00 MST 2002
24
irb(main):005:0> p t + 3600 * 1
Sun Oct 27 01:00:00 MDT 2002
nil
irb(main):006:0> p t + 3600 * 2
Sun Oct 27 01:00:00 MST 2002
nil
irb(main):007:0> p t + 3600
Sun Oct 27 01:00:00 MDT 2002
nil
irb(main):008:0> p t + 7200
Sun Oct 27 01:00:00 MST 2002
nil
this looks like a bug!
-a
···
On 11 Dec 2002, Travis Whitton wrote:
–
====================================
Ara Howard
NOAA Forecast Systems Laboratory
Information and Technology Services
Data Systems Group
R/FST 325 Broadway
Boulder, CO 80305-3328
Email: ahoward@fsl.noaa.gov
Phone: 303-497-7238
Fax: 303-497-7259
====================================
SIGSIG – signature too long (core dumped)
irb(main):004:0> Time.local(2002, 10, 27)
Sun Oct 27 00:00:00 EDT 2002
irb(main):005:0> Time.local(2002, 10, 27) + 86400
Sun Oct 27 23:00:00 EST 2002
So, adding the amount of seconds to equal one day to 10/27/2002 only
brings it up to 23:00. If this is something completely obvious, please
enlighten me. It’s causing quite a stir in my program…
–
/ Alexander Bokovoy
As a computer, I find your faith in technology amusing.
i guess maybe daylight savings time takes effect at 1:59 am, though that
suprised me… i always assumed 00:00
-a
···
On Wed, 11 Dec 2002, ahoward wrote:
On 11 Dec 2002, Travis Whitton wrote:
[snip]
I’m manipulating some dates, and I just found something weird.
[snip]
and even weirder :
–
====================================
Ara Howard
NOAA Forecast Systems Laboratory
Information and Technology Services
Data Systems Group
R/FST 325 Broadway
Boulder, CO 80305-3328
Email: ahoward@fsl.noaa.gov
Phone: 303-497-7238
Fax: 303-497-7259
====================================
SIGSIG – signature too long (core dumped)
I’m manipulating some dates, and I just found something weird.
[snip]
and even weirder :
~ > irb
irb(main):001:0> t = Time.local(2002, 10, 27)
Sun Oct 27 00:00:00 MDT 2002
irb(main):002:0> 24.times do |h|
irb(main):003:1* p t + 3600 * h
irb(main):004:1> end
Sun Oct 27 00:00:00 MDT 2002
Sun Oct 27 01:00:00 MDT 2002
Sun Oct 27 01:00:00 MST 2002
Sun Oct 27 02:00:00 MST 2002
Sun Oct 27 03:00:00 MST 2002
[…]
irb(main):005:0> p t + 3600 * 1
Sun Oct 27 01:00:00 MDT 2002
nil
irb(main):006:0> p t + 3600 * 2
Sun Oct 27 01:00:00 MST 2002
nil
irb(main):007:0> p t + 3600
Sun Oct 27 01:00:00 MDT 2002
nil
irb(main):008:0> p t + 7200
Sun Oct 27 01:00:00 MST 2002
nil
this looks like a bug!
I’m probably being completely thick, but what part of this
looks bug-like?