DateTime now

28 views
Skip to first unread message

John Merlino

unread,
Sep 15, 2013, 10:51:10 AM9/15/13
to rubyonra...@googlegroups.com
When using DateTime.now, does the "now" method return the time based on the remote OS system time or the local time where the user actually invoked the "now" method, if they are using ssh and running the commands in a rails console, for example?

Colin Law

unread,
Sep 15, 2013, 11:43:16 AM9/15/13
to rubyonra...@googlegroups.com
It returns the time on the machine that is running the code, so if
they ssh into a machine to run it then it is the time on the machine
ssh'ed into. How could it be otherwise? The machine ssh'ed into does
not know anything about the client machine's time settings.

Colin

>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/46b3432f-5ab4-42f8-9ac2-1ea8bb30cbb0%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages