2
votes

I'm working on an app which has its config.time_zone = 'Kolkata' (which is UTC +5:30), I'm trying to save the time for a particular object in EST/EDT (UTC -5:00/-4:00) from the ActiveAdmin panel.

Since it involves daylight savings, I'd rather not resort to manual calculations and transform the ActiveSupport::TimeWithZone object from UTC +530 into UTC -400. Is it possible to just change the zone part of a TimeWithZone object without converting it?

P.S. I did come across this question. But it isn't have the answer I'm looking for.(one of the comments even mention it)

1
Also looking for something like change method of DateTime where we can specify timezone offset.Zia Ul Rehman Mughal

1 Answers

-1
votes

It is recommended that all datetime objects should always be stored in UTC -0000, as said here. If yet you want to convert it to do some calculations, use the utc_offset method or convert both objects to UTC by using the utc method, as seen here.