Here's one way, but it's can you think of a nicer or more 'railsy' method?
>> Time.use_zone('Sydney'){ Time.zone.parse('2011-04-12 2pm') } => Tue, 12 Apr 2011 14:00:00 EST +10:00
I think you're looking for
Time.find_zone('Alaska').local(2011,1,1) => Sat, 01 Jan 2011 00:00:00 AKST -09:00 Time.find_zone('Amsterdam').local(2011,1,1) => Sat, 01 Jan 2011 00:00:00 CET +01:00 Time.find_zone('Sydney').local(2011,1,1) => Sat, 01 Jan 2011 00:00:00 EST +11:00 Time.find_zone('Wellington').local(2011,1,1) => Sat, 01 Jan 2011 00:00:00 NZDT +13:00
This also works with parse
Time.find_zone('Sydney').parse('2011-04-12 2pm') => Tue, 12 Apr 2011 14:00:00 EST +10:00
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With