Saving different time zone in rails

Hi all,

Im having an issue regarding saving time in db.

First my requirement is -

1.I save current date and time in “Publish on” field.

  1. Now this should be changed to date and time based on user’s location
    which will be stored.

For example, if user is in EST, The publish on date should be in EST

I used this,


when i put the string, it shows time based on EST or MST.

But while storing the date, it stores in default time zone.

Can anyone suggest me in this on how to save different time zone in

Always save time in UTC.

You can add an additional string field if necessary that contains a
string of the time zone it came from.


It’s a normal pattern in rails. It always save the timestamp in GMT
timezone, and you never change it!

I suggest to you create a helper to calculate the time based in the


Felipe Fontoura
Eng. de Computao

2011/12/28 angel david [email protected]