Subject: | method from_epoch reloads time_zone |
The method from_epoch creates a DateTime::TimeZone object
of type 'UTC'
my $self = $class->_new( %p, %args, time_zone => 'UTC' );
and then sets the new time_zone provided
if needed:
$self->set_time_zone( $p{time_zone} ) if exists $p{time_zone};
In case you provide a time_zone, this leads to the creation of two
objects, while there is no need.
Could this be better?
my $self = $class->_new( %p, %args, time_zone => exists($p{time_zone}) ? $p{time_zone} : 'UTC' );
And then delete the line that sets the time_zone?
Or has this a special reason?
Thanks in advance!
greetings