Forum: Ruby on Rails Time Zone

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
589525f133e603e1f17af9b03176c000?d=identicon&s=25 Abhishek shukla (Guest)
on 2008-10-13 19:02
(Received via mailing list)
Hello friends,
My question is like if the user select the time zone for his country the
application timezone should display the selected time zone.

so for implement this what i should do?

regards
abhi
55d6457963d5be7ad341343105ddc8a3?d=identicon&s=25 Nathan Esquenazi (xgamerx)
on 2008-10-14 05:37
Follow this tutorial:

http://mad.ly/2008/04/09/rails-21-time-zone-suppor...

Abhishek shukla wrote:
> Hello friends,
> My question is like if the user select the time zone for his country the
> application timezone should display the selected time zone.
>
> so for implement this what i should do?
>
> regards
> abhi
589525f133e603e1f17af9b03176c000?d=identicon&s=25 Abhishek shukla (Guest)
on 2008-10-14 09:25
(Received via mailing list)
Hi nathan,
Thanks for your response,
Still i am very confuse my requirement is like a user save there
timezone,
then whenever he logs in he should see the time as per wat he set in
timezone currently it displaying my system timezone.

So what excatly i'll need to do? Do i need to create a method in which
i'll
need to set the timezone?

On Tue, Oct 14, 2008 at 9:07 AM, Nathan Esquenazi <
Bee69cfed999cd13e3bff73d472a39ee?d=identicon&s=25 Hassan Schroeder (Guest)
on 2008-10-15 16:32
(Received via mailing list)
On Tue, Oct 14, 2008 at 12:24 AM, Abhishek shukla <betterabhi@gmail.com>
wrote:

> Still i am very confuse my requirement is like a user save there timezone,
> then whenever he logs in he should see the time as per wat he set in
> timezone currently it displaying my system timezone.
>
> So what excatly i'll need to do? Do i need to create a method in which i'll
> need to set the timezone?

If you store the timezone as part of the user model, displaying the
appropriate local time would just be:
  @user.tz.now

HTH,
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
This topic is locked and can not be replied to.