# Activerecord time problem

**URL:** <https://www.ruby-forum.com/t/activerecord-time-problem/108588>\
**Category:** Rails\
**Created:** [July 5, 2007, 4:59am UTC](https://www.ruby-forum.com/t/activerecord-time-problem/108588 "2007-07-05T04:59:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antti\_Akonniemi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@Antti\_Akonniemi](https://www.ruby-forum.com/u/Antti_Akonniemi)\
**Post date:** [July 5, 2007, 4:59am UTC](https://www.ruby-forum.com/t/activerecord-time-problem/108588/1 "2007-07-05T04:59:37Z")

</div>

Hi,

I have a strange problem in my hands. My application works correctly for  
a while (I don’t know actual time but it is hours), but then suddenly  
created\_at/updated\_at timestamps are stored in UTC and not in the  
correct timezone (server is in that timezone, mysql gives correct time,  
environment.rb has the correct timezone).

Any ideas what is causing this? And more importantly - how to fix this?  
I don’t want to be restarting my server every now and then because of  
this 🙂

rails 1.2.2  
mysql 5.0.32

-antti

---

<div class="post-metadata">

**Author:** ![Antti\_Akonniemi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@Antti\_Akonniemi](https://www.ruby-forum.com/u/Antti_Akonniemi)\
**Post date:** [July 5, 2007, 10:22am UTC](https://www.ruby-forum.com/t/activerecord-time-problem/108588/2 "2007-07-05T10:22:32Z")

</div>

Antti Akonniemi wrote:

> Hi,
> 
> I have a strange problem in my hands. My application works correctly for  
> a while (I don’t know actual time but it is hours), but then suddenly  
> created\_at/updated\_at timestamps are stored in UTC and not in the  
> correct timezone (server is in that timezone, mysql gives correct time,  
> environment.rb has the correct timezone).
> 
> Any ideas what is causing this? And more importantly - how to fix this?  
> I don’t want to be restarting my server every now and then because of  
> this 🙂
> 
> rails 1.2.2  
> mysql 5.0.32

I should add that this concerns only ActiveRecord - otherwise current  
time is shown correctly.

-antti
