# Rails 2.1 DST Issues

**URL:** <https://www.ruby-forum.com/t/rails-2-1-dst-issues/141595>\
**Category:** Rails\
**Created:** [June 27, 2008, 1:49pm UTC](https://www.ruby-forum.com/t/rails-2-1-dst-issues/141595 "2008-06-27T13:49:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nauhaie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3ab097/32.png) [@nauhaie](https://www.ruby-forum.com/u/nauhaie)\
**Post date:** [June 27, 2008, 1:49pm UTC](https://www.ruby-forum.com/t/rails-2-1-dst-issues/141595/1 "2008-06-27T13:49:34Z")

</div>

Hi all!

Here is some interesting result with Rails 2.1 (without any specific  
TimeZone configuration).

As you will see, adding 3.hours and then 21.hours doesn’t give the same  
result as adding 24.hours around DST change!

Loading development environment (Rails 2.1.0)

> > t = Time.parse(“Sun Oct 26 00:30:00 +0200 2008”)

I live in Switzerland, and DST change just happens at 02:00:00

As expected:

> > t2 = t+3.hours  
> > =\> Sun Oct 26 02:30:00 +0100 2008

As you can see, the “missing” hour is taken into account, which is what  
you would expect!

Now, let’s add 21 more hours:

> > t2 = t2+21.hours  
> > =\> Sun Oct 26 23:30:00 +0100 2008

Which is right, too, since 24.hours have actually passed between the two  
displayed dates!

However, now just try the following:

> > t  
> > =\> Sun Oct 26 00:30:00 +0200 2008
> 
> > t3 = t+24.hours  
> > =\> Mon Oct 27 00:30:00 +0100 2008

Huho! There is something wrong here!

Long story short:

> > (t+24.hours)==((t+3.hours)+21.hours)  
> > =\> false

Is there anything I am missing?
