DateTime.strptime bug?

Bryan Cheng
Thu, 30 Jun 2011 21:40:59 -0000

Hi everyone,

I''ve been trying to find a solution for this but can''t seem to
find
anything. I''m current in Daylight Savings Pacific Time (-07:00).
I''ve
configured all my default time zones to be for Pacific Time (US &
Canada). Everything works fine with ActiveRecords and filtering,
except DateTime.strptime which does not seem to recognize that
daylight savings is in effect.

I have something like this:

self.deadline = DateTime.strptime(deadline_date + " " + deadline_time
+ " " + time_zone, "%m/%d/%Y %H:%M:%S %Z") and it saves just
fine
except it''s an hour off. Any suggestions/help?

Thanks!

--
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