Forum: Ruby on Rails Server time.

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.
0a36dd2d45a8cead5dcfd27a9346f620?d=identicon&s=25 Mohammad (Guest)
on 2006-05-08 03:29
Hello I just set up my db to save Time(now)(IN SQL not ruby's Time.now)
But, this is local user time correct? If not or even so I would also
like to be able to call servers Time.now in my app so how can I do this?

Thanks in advance,
noobie Mohammad
0a36dd2d45a8cead5dcfd27a9346f620?d=identicon&s=25 Mohammad (Guest)
on 2006-05-08 18:56
Mohammad wrote:
> Hello I just set up my db to save Time(now)(IN SQL not ruby's Time.now)
> But, this is local user time correct? If not or even so I would also
> like to be able to call servers Time.now in my app so how can I do this?
>
> Thanks in advance,
> noobie Mohammad

Time.now is local user time correct?
D0cd6b10e01bacb976b3b815a9c660bc?d=identicon&s=25 Alex Wayne (Guest)
on 2006-05-08 19:02
Mohammad wrote:
> Hello I just set up my db to save Time(now)(IN SQL not ruby's Time.now)
> But, this is local user time correct? If not or even so I would also
> like to be able to call servers Time.now in my app so how can I do this?
>
> Thanks in advance,
> noobie Mohammad

MySQL has no idea what local user time even means.  If you setup a time
default in the DB it will always be Server time.  And Time.now is also
always server time.

You cant really get the local user time in ruby code without some
special handling and collecting of the users timezone.
This topic is locked and can not be replied to.