Forum: Ruby PST/PDT with DateTime.parse

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Bd75ace2ea60add6a4ba89dc9c0035d8?d=identicon&s=25 Refael D. (refaelos)
on 2016-08-30 11:41

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?

This topic is locked and can not be replied to.