aboutsummaryrefslogtreecommitdiff
path: root/perl/lib/Wallet/ACL.pm
diff options
context:
space:
mode:
authorRuss Allbery <eagle@eyrie.org>2014-07-15 20:46:57 -0700
committerRuss Allbery <rra@stanford.edu>2014-07-15 21:10:57 -0700
commitc2112bf049d193c677335c94b477eb5cadb403ed (patch)
tree2cd6c0d08fe77f1a95949d09a535fb3843a1bd2b /perl/lib/Wallet/ACL.pm
parent443c2c7ac38672f18a14a84e7a220d1a3b1cd545 (diff)
Use DateTime objects uniformly, improve expires parsing
Always use DateTime objects for every date field in the database, and translate them into the local time zone for display when pulling them out of the database. This should provide better portability to different database backends. Change the parsing of expires arguments to use Date::Parse, thus supporting a much broader variety of possible date and time formats and allowing easy conversion to a DateTime object. Document the new dependency. Change-Id: I2ee8eaa6aa6ae9925ac419e49234ec9880d4fe95 Reviewed-on: https://gerrit.stanford.edu/1555 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
Diffstat (limited to 'perl/lib/Wallet/ACL.pm')
-rw-r--r--perl/lib/Wallet/ACL.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/perl/lib/Wallet/ACL.pm b/perl/lib/Wallet/ACL.pm
index b488b43..a3b0146 100644
--- a/perl/lib/Wallet/ACL.pm
+++ b/perl/lib/Wallet/ACL.pm
@@ -378,8 +378,9 @@ sub history {
my @data = $self->{schema}->resultset('AclHistory')
->search (\%search, \%options);
for my $data (@data) {
- $output .= sprintf ("%s %s ", $data->ah_on->ymd,
- $data->ah_on->hms);
+ my $date = $data->ah_on;
+ $date->set_time_zone ('local');
+ $output .= sprintf ("%s %s ", $date->ymd, $date->hms);
if ($data->ah_action eq 'add' || $data->ah_action eq 'remove') {
$output .= sprintf ("%s %s %s", $data->ah_action,
$data->ah_scheme, $data->ah_identifier);