On 3 April 2010 00:37, Dudebot <craign...@gmail.com> wrote: > > > On Apr 2, 6:05 pm, Craig White <craigwh...@azapple.com> wrote: > >> they actually are in sync >> >> Fri Apr 2 17:13:05 CDT 2010 == 2010-04-02 22:13:05 (UTC) as CDT is UTC >> + 5 hours > > Sorry for my sloppiness--I understand. I guess my main question is why > would it show the correct time in the view on one machine, but not > another? > > datetime.strftime("%A %B %d %Y %I:%M:%S %p") > > Is different for each machine. I'm busily writing code to detect > where the user is, and adjusting the time shown in the view > accordingly, but I'm still mildly confused by why the two views show > differently.
The above code will assume that you want to display it in local time, if you change which timezone you tell rails it is in then that will change the display of local time. Values in the db will always be in UTC as far as Rails is concerned. How are you detecting which timezone the user is in? I did not think it was possible (other than asking him of course). Colin > > Thanks, > Craig > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-t...@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.