You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The section "TIME ZONES" describes how to convert a Time::Moment object to a different time zone using DateTime::TimeZone, either preserving the instant or the local time. I think it would be very convenient to have methods that take a DateTime::TimeZone object, or possibly even a string that can be passed to the DT::TZ constructor (such as you can do with DateTime->set_time_zone), and does the conversion described in those examples. I basically have a function that does this for me at the moment to avoid repeating code, but it would be more convenient to be able to do for example:
my $moment = Time::Moment->from_epoch($epoch)->with_time_zone_same_instant($tz)
The text was updated successfully, but these errors were encountered:
The methods can't be named ->with_time_zone_same_instant or ->with_time_zone_same_local since the time zone isn't retained with Time::Moment, perhaps ->with_time_zone_offset_same_instant and ->with_time_zone_offset_same_local, but I'll have to give this some thought. I'm not particular fond of DateTime::TimeZone's API or performance, something I intend to address (and already have done in DPAN code).
The section "TIME ZONES" describes how to convert a Time::Moment object to a different time zone using DateTime::TimeZone, either preserving the instant or the local time. I think it would be very convenient to have methods that take a DateTime::TimeZone object, or possibly even a string that can be passed to the DT::TZ constructor (such as you can do with DateTime->set_time_zone), and does the conversion described in those examples. I basically have a function that does this for me at the moment to avoid repeating code, but it would be more convenient to be able to do for example:
The text was updated successfully, but these errors were encountered: