I have a date string 20101129220021, so I will use
require 'date'
d = DateTime.parse('20101129220021')
This part is working fine, and I get a date that is in UTC.
My question is, how can I convert this to my local time? I tried many methods, such as extracting the time part with help d.to_timeand manipulating the result, but that did not work. As far as I know, the object is DateTimeimmutable. Can i get help?
source
share