From 32a240f11da661c63ddfb469a1242f2736245f46 Mon Sep 17 00:00:00 2001 From: miker Date: Thu, 14 Jul 2005 20:15:13 +0000 Subject: [PATCH] added date clenser so we can use DateTime::Format::ISO8601 git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@393 9efc2488-bf62-4759-914b-345cdb29e865 --- src/perlmods/OpenSRF/Utils.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/perlmods/OpenSRF/Utils.pm b/src/perlmods/OpenSRF/Utils.pm index f24d7d7..285e0f2 100644 --- a/src/perlmods/OpenSRF/Utils.pm +++ b/src/perlmods/OpenSRF/Utils.pm @@ -334,6 +334,16 @@ sub set_psname { $0 = $PS_NAME if ($PS_NAME); } +sub clense_ISO8601 { + my $self = shift; + my $date = shift || $self; + if ($date =~ /(\d{4})-?(\d{2})-?(\d{2}).?(\d{2}):(\d{2}):(\d{2})\.?\d*((?:-|\+)\d{2,4})?$/) { + my $z = $7 || '-00'; + $date = "$1-$2-$3T$4:$5:$6$z"; + } + return $date; +} + =head2 $utils_obj->daemonize('ps_name') OR daemonize('ps_name') Turns the current process into a daemon. B is optional, and is used -- 2.11.0