I''m using rails 2.3.2. I have Date/Time data stored in a SQL Server database. All values are UTC (although the database just stores the time, not the zone). All of my computers are in the America/New York time zone. It was my understanding that rails expects a UTC time to come from the database. But, it looks like rails assumes that the time value is really local (in my case, UTC - 5 hours) and converts it by adding 5 hours. Which is not what I want. How can I tell rails that the times *are* UTC and to leave them alone? --~--~---------~--~----~------------~-------~--~----~ 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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> How can I tell rails that the times *are* UTC and to leave them alone?Put config.time_zone = ''UTC'' in your environment.rb. Actually if you look closely, it''s probably already there, just commented out by default. - D -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
That line was already there, and is not commented. On Mar 28, 2:22 am, Danny Burkes <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > How can I tell rails that the times *are* UTC and to leave them alone? > > Put > > config.time_zone = ''UTC'' > > in your environment.rb. Actually if you look closely, it''s probably > already there, just commented out by default. > > - D > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Rick Schumeyer wrote:> I''m using rails 2.3.2.> But, it looks like rails assumes that the time value is really local > (in my case, UTC - 5 hours) and converts it by adding 5 hours. Which > is not what I want. > > How can I tell rails that the times *are* UTC and to leave them alone?How are you "looking" at the database values? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---