From 4e84fd93e902bda272f77338234c82dad857038a Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Tue, 20 May 2014 14:30:20 -0400 Subject: [PATCH] LP#1321429: Use server-local time as best-guess 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 Signed-off-by: Ben Shum --- Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm index 45b213346f..794f2dd1b3 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm @@ -1110,7 +1110,7 @@ sub set_hold_shelf_expire_time { $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); -- 2.11.0