I want to save my datetime and display it using a user''s TimeZone ignoring DST at all times. Is this possible? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
See if TimeZone.period_for_local works for you. It has a DST=false parameter.<http://tzinfo.rubyforge.org/doc/classes/TZInfo/Timezone.html#M000051> -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mar 30, 2:06 pm, Coderama <prime.coder...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I want to save my datetime and display it using a user''s TimeZone > ignoring DST at all times. Is this possible?Rather than storing a timezone string you could just store the offset, so since I''m in "Central Time US & Canada" I would just use "-0600" which would avoid DST when we switch to -0500. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
On 30 March 2011 20:06, Coderama <prime.coderama-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I want to save my datetime and display it using a user''s TimeZone > ignoring DST at all times. Is this possible?Do you know what the user''s timezone is? If so then take the timezone offset (which is distinct from the DST setting) and calculate the time accordingly. Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.