PST/PDT with DateTime.parse

Hey,

I want to be able to parse a date string which might be in PST or PDT
according to daylight savings. This means that half a year the date will
be PST and the other half the date will be PDT.

This is my code now:

DateTime.parse(‘2016-02-21 10:00:02 PST/PDT’)

This will only parse the date as PST (GMT-8).

How can I parse a date+time in PST/PDT automatically?

Thanks!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs