D
Dany
I need to parse the following date string (part of a file I need to
parse)
irb(main):001:0> date='Fri Jun 20 02:32:28 GST 2008'
=> "Fri Jun 20 02:32:28 GST 2008"
It seems like the DateTime parsing handles GST as Guam Standard time
UTC+10
irb(main):002:0> require 'date'
=> true
irb(main):003:0> DateTime.parse(date).zone
=> "+10:00"
In my case, GST is Gulf Standard Time UTC+4
My thought for a 'quick' workaround fix, was to modify the value in
the library/moduel
irb(main):004:0> puts Date::Format::ZONES['gst']
36000
=> nil
irb(main):005:0> Date::Format::ZONES['gst'] = 4*3600
TypeError: can't modify frozen hash
from (irb):5:in `[]='
from (irb):5
But as the output shows, the value is 'frozen' in that library. I am
looking for ideas how to workaround my issue. Any help appreciated.
BTW, I'm not a programmer and I have not done much with Ruby, yet.
Thanks,
Dany
parse)
irb(main):001:0> date='Fri Jun 20 02:32:28 GST 2008'
=> "Fri Jun 20 02:32:28 GST 2008"
It seems like the DateTime parsing handles GST as Guam Standard time
UTC+10
irb(main):002:0> require 'date'
=> true
irb(main):003:0> DateTime.parse(date).zone
=> "+10:00"
In my case, GST is Gulf Standard Time UTC+4
My thought for a 'quick' workaround fix, was to modify the value in
the library/moduel
irb(main):004:0> puts Date::Format::ZONES['gst']
36000
=> nil
irb(main):005:0> Date::Format::ZONES['gst'] = 4*3600
TypeError: can't modify frozen hash
from (irb):5:in `[]='
from (irb):5
But as the output shows, the value is 'frozen' in that library. I am
looking for ideas how to workaround my issue. Any help appreciated.
BTW, I'm not a programmer and I have not done much with Ruby, yet.
Thanks,
Dany