When first calculating the shelf expire time, we assume "now" as
the starting point by calling DateTime->now(). However, that gives
us the time in UTC. That's not good because closed dates are stored
timezone-aware. Instead, ask for server-local time.
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
$start_time = ($start_time) ?
DateTime::Format::ISO8601->new->parse_datetime(cleanse_ISO8601($start_time)) :
- DateTime->now;
+ DateTime->now(time_zone => 'local'); # without time_zone we get UTC ... yuck!
my $seconds = OpenSRF::Utils->interval_to_seconds($shelf_expire);
my $expire_time = $start_time->add(seconds => $seconds);