# Rails Time extensions are \_not\_ time difference safe

**URL:** <https://www.ruby-forum.com/t/rails-time-extensions-are-not-time-difference-safe/70574>\
**Category:** Rails\
**Created:** [September 30, 2006, 10:36am UTC](https://www.ruby-forum.com/t/rails-time-extensions-are-not-time-difference-safe/70574 "2006-09-30T10:36:19Z")\
**Posts on this page:** 4\
**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:** [September 30, 2006, 10:36am UTC](https://www.ruby-forum.com/t/rails-time-extensions-are-not-time-difference-safe/70574/1 "2006-09-30T10:36:19Z")

</div>

=\> Sun Oct 29 09:32:08 +0100 2006

> > t.beginning\_of\_day  
> > =\> Sun Oct 29 01:00:00 +0200 2006
> 
> >

Is 1 am really beginning of day?

Nothing more to say. In Europe, pretty much every country adds an hour  
or remove it twice a year. It just breaks beginning\_of\_day and a lot of  
week-computations…

Huh? No one cares?

Nauhaie

---

<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:** [September 30, 2006, 11:24am UTC](https://www.ruby-forum.com/t/rails-time-extensions-are-not-time-difference-safe/70574/2 "2006-09-30T11:24:48Z")

</div>

I believe Mephisto uses the TZInfo gem to fix just that.

---

<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:** [September 30, 2006, 12:11pm UTC](https://www.ruby-forum.com/t/rails-time-extensions-are-not-time-difference-safe/70574/3 "2006-09-30T12:11:34Z")

</div>

Ok… TZInfo does not seem to patch beginning\_of\_day and other Rails  
Time calculations…

And that doesn’t change the fact that there is a bug in rails…

---

<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:** [October 1, 2006, 4:14pm UTC](https://www.ruby-forum.com/t/rails-time-extensions-are-not-time-difference-safe/70574/4 "2006-10-01T16:14:47Z")

</div>

On Sep 30, 2006, at 6:11 AM, Nauhaie N. wrote:

> Ok… TZInfo does not seem to patch beginning\_of\_day and other Rails  
> Time calculations…
> 
> And that doesn’t change the fact that there is a bug in rails…
> 
> – Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

Well, you’re free to try the patch I submitted a while back.

[http://dev.rubyonrails.org/ticket/5617](http://dev.rubyonrails.org/ticket/5617)

-Rob

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid  
+1 513-295-4739

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid  
+1 513-295-4739
