# Time Problem

**URL:** <https://www.ruby-forum.com/t/time-problem/196802>\
**Category:** Rails\
**Created:** [September 10, 2008, 9:41am UTC](https://www.ruby-forum.com/t/time-problem/196802 "2008-09-10T09:41:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunfish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/96bed5/32.png) [@sunfish](https://www.ruby-forum.com/u/sunfish)\
**Post date:** [September 10, 2008, 9:41am UTC](https://www.ruby-forum.com/t/time-problem/196802/1 "2008-09-10T09:41:38Z")

</div>

Hi,  
In my application I have to correct the time stamp on event  
discussion posts. Perhaps they are not observing DST? In any case, they  
are slow by one hour.  
how to do this ? I have following type of code and I have been using  
rails 1.3:-

\<%= frmt\_note\_date(message.created\_on) %\> at  
\<%=  
display\_formated\_time(user\_timezone\_dateTime(message.created\_on,‘fmt\_in\_dateTime’).split(’  
at ').last)  
%\>

above code shows me:- 9/08/2008 at 4:32 AM

---

<div class="post-metadata">

**Author:** ![sunfish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/96bed5/32.png) [@sunfish](https://www.ruby-forum.com/u/sunfish)\
**Post date:** [September 11, 2008, 5:47am UTC](https://www.ruby-forum.com/t/time-problem/196802/2 "2008-09-11T05:47:15Z")

</div>

On Wed, Sep 10, 2008 at 5:41 PM, Sunny B.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> In my application I have to correct the time stamp on event  
> discussion posts. Perhaps they are not observing DST? In any case, they  
> are slow by one hour.

If you just want to add one hour to the time regardless of timezone,  
the simplest thing that would work is:

$ ./script/console  
Loading development environment.

> > Time.now  
> > =\> Thu Sep 11 13:45:29 +1000 2008  
> > \_ + 1.hour  
> > =\> Thu Sep 11 14:45:29 +1000 2008

–

> **[Mikel Lindsaar](https://lindsaar.net/)**
>
> Internet Home for Mikel Lindsaar

Rails, RSpec and Life blog…
