# Created\_at and updated\_at timestamps wrong

**URL:** <https://www.ruby-forum.com/t/created-at-and-updated-at-timestamps-wrong/66525>\
**Category:** Radiant CMS\
**Created:** [August 26, 2006, 3:34pm UTC](https://www.ruby-forum.com/t/created-at-and-updated-at-timestamps-wrong/66525 "2006-08-26T15:34:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saint\_Berry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/2acd7d/32.png) [@Saint\_Berry](https://www.ruby-forum.com/u/Saint_Berry)\
**Post date:** [August 26, 2006, 3:34pm UTC](https://www.ruby-forum.com/t/created-at-and-updated-at-timestamps-wrong/66525/1 "2006-08-26T15:34:44Z")

</div>

I have just noticed that the updated\_at and created\_at timestamps are  
about  
10 hours behind. At the moment I am running radiant locally, so if I  
updated  
a page at 11pm according to my computers time, updated\_at will get a  
timestamp for the same day at 1pm.

This does not effect the published\_at timestamp, it is spot on.

At first I thought this might be a rails problem however other apps I’ve  
made and run on the same localhost record the correct time for updated  
and  
created at.

Does radiant have a time offset setting somewhere that I have totally  
missed?

Cheers,  
David Berry

---

<div class="post-metadata">

**Author:** ![Saint\_Berry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/2acd7d/32.png) [@Saint\_Berry](https://www.ruby-forum.com/u/Saint_Berry)\
**Post date:** [August 26, 2006, 3:58pm UTC](https://www.ruby-forum.com/t/created-at-and-updated-at-timestamps-wrong/66525/2 "2006-08-26T15:58:46Z")

</div>

Saint Berry wrote:

> I have just noticed that the updated\_at and created\_at timestamps are about  
> 10 hours behind. At the moment I am running radiant locally, so if I  
> updated  
> a page at 11pm according to my computers time, updated\_at will get a  
> timestamp for the same day at 1pm.
> 
> This does not effect the published\_at timestamp, it is spot on.

created\_at and updated\_at are automagically updated by Rails. So they  
are using whatever algorithm Rails uses to calculate the time. Published  
at doesn’t do anything special. It uses Time.now:

[http://dev.radiantcms.org/radiant/browser/trunk/radiant/app/models/page.rb#L81](http://dev.radiantcms.org/radiant/browser/trunk/radiant/app/models/page.rb#L81)

What would you suggest?

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![Saint\_Berry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/2acd7d/32.png) [@Saint\_Berry](https://www.ruby-forum.com/u/Saint_Berry)\
**Post date:** [August 26, 2006, 4:34pm UTC](https://www.ruby-forum.com/t/created-at-and-updated-at-timestamps-wrong/66525/3 "2006-08-26T16:34:02Z")

</div>

John W. Long wrote:

> created\_at and updated\_at are automagically updated by Rails. So they  
> are using whatever algorithm Rails uses to calculate the time. Published  
> at doesn’t do anything special. It uses Time.now:
> 
> [http://dev.radiantcms.org/radiant/browser/trunk/radiant/app/models/page.rb#L81](http://dev.radiantcms.org/radiant/browser/trunk/radiant/app/models/page.rb#L81)
> 
> What would you suggest?
> 
> –  
> John L.  
> [http://wiseheartdesign.com](http://wiseheartdesign.com)

Hi John.

Tis a strange one indeed. I assumed that would be the case, yet it seems  
random that other rails apps on this host don’t have the problem, just  
radiant apps.

I have tried creating new radiant apps, using the .zip and also via the  
gem, running in application or dev mode, creating new databases etc and  
still all updated\_at and created\_at timestamps are 10hours behind.

In regards to the link you posted I am having trouble getting onto the  
radiant site at the moment (just times out), but I imagine you are  
referring to the line where published\_at gets populated with Time.now. I  
had a look at that and as I said its working fine. Only the internal  
rails operations have the issueâ?¦

It must be something local… It could be a whole host of things,  
including the mysql server I guess.

I shall continue to investigate and post my findings here.

Regards,  
David

---

<div class="post-metadata">

**Author:** ![Saint\_Berry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/2acd7d/32.png) [@Saint\_Berry](https://www.ruby-forum.com/u/Saint_Berry)\
**Post date:** [August 28, 2006, 3:57am UTC](https://www.ruby-forum.com/t/created-at-and-updated-at-timestamps-wrong/66525/4 "2006-08-28T03:57:45Z")

</div>

On Aug 26, 2006, at 11:34 PM, Guest wrote:

> It must be something local… It could be a whole host of things,  
> including the mysql server I guess.
> 
> I shall continue to investigate and post my findings here.

David, can you send us details about the platform you are on? (eg. OS  
X, MySQL 5.1 etc)

I’m going to try to investigate this afternoon.

Bodhi

---

<div class="post-metadata">

**Author:** ![Saint\_Berry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/2acd7d/32.png) [@Saint\_Berry](https://www.ruby-forum.com/u/Saint_Berry)\
**Post date:** [August 28, 2006, 2:20pm UTC](https://www.ruby-forum.com/t/created-at-and-updated-at-timestamps-wrong/66525/5 "2006-08-28T14:20:51Z")

</div>

Bodhi wrote:

> David, can you send us details about the platform you are on? (eg. OS  
> X, MySQL 5.1 etc)
> 
> I’m going to try to investigate this afternoon.
> 
> Bodhi

Awesome thanks Bodhi - havent been able to look into this due to uni  
commitments…

OS: Windows XP x64  
MySQL: Sever 5.0.21 (32bit version)  
Rails: 1.1.6

Most of the time I launch the webbrick server via RadRails however the  
problem persists if I launch the sever via the command line.

Cheers,  
David Berry
