From 8a17b167d6bac5d9e0fdcb9c36c2f6b683842512 Mon Sep 17 00:00:00 2001 From: ellen56 Date: Sun, 27 Mar 2011 12:18:38 +0000 Subject: [PATCH] change eventtime format from mm-dd-yyyy to yyyy-mm-dd git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9156 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Utils.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index 9c417f723..028d001e0 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -2348,7 +2348,7 @@ sub my_nets my $n = $_->{net}; my $if = $_->{mgtifname}; my $nm = $_->{mask}; - if (!$n || !$if || !$nm) + if (!$n || !$if || $nm) { next; #incomplete network } @@ -4328,7 +4328,7 @@ sub get_image_name Arguments: arrayref -- A pointer to an array. Each element is a hash that contains an events. The hash should contain the at least one of the following keys: - eventtime -- The format is "mm-dd-yyyy hh:mm:ss". + eventtime -- The format is "yyyy-mm-dd hh:mm:ss". If omitted, the current date and time will be used. monitor -- The name of the monitor that monitors this event. monnode -- The node that monitors this event. @@ -4344,7 +4344,7 @@ sub get_image_name Example: my @a=(); my $event={ - eventtime=>"07-28-2009 23:02:03", + eventtime=>"2009-07-28 23:02:03", node => 'node1', rawdata => 'kjdlkfajlfjdlksaj', }; @@ -4394,8 +4394,8 @@ sub logEventsToDatabase $year, $wday, $yday, $isdst ) = localtime(time); - $currtime = sprintf("%02d-%02d-%04d %02d:%02d:%02d", - $mon + 1, $mday, $year + 1900, + $currtime = sprintf("%04d-%02d-%02d %02d:%02d:%02d", + $year + 1900, $mon + 1, $mday, $hour, $min, $sec); } $event->{eventtime} = $currtime;