]> granicus.if.org Git - apache/commitdiff
Removes calls to `date`.
authorRich Bowen <rbowen@apache.org>
Thu, 12 Apr 2012 12:47:53 +0000 (12:47 +0000)
committerRich Bowen <rbowen@apache.org>
Thu, 12 Apr 2012 12:47:53 +0000 (12:47 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1325227 13f79535-47bb-0310-9956-ffa450edef68

support/log_server_status.in

index 6f0505f05d7674b24370d943d940abf916a31ded..bf9d6840201a2e6d0d38c45336696559b0daa164 100644 (file)
@@ -55,12 +55,18 @@ sub tcp_connect
 ### Main
 
 {
-    my $year = `date +%y`;
-    chomp($year);
-    $year += ( $year < 70 ) ? 2000 : 1900;
-    my $date = $year . `date +%m%d:%H%M%S`;
-    chomp($date);
-    my ( $day, $time ) = split( /:/, $date );
+    my @ltime = localtime(time);
+    
+    my $day =
+        $ltime[5] + 1900
+      . sprintf( "%02d", $ltime[4] + 1 ) 
+      . sprintf( "%02d", $ltime[3] );
+
+    my $time =
+        sprintf( "%02d", $ltime[2] )
+      . sprintf( "%02d", $ltime[1] )
+      . sprintf( "%02d", $ltime[0] );
+
     my $res = &tcp_connect( $server, $port );
     open( OUT, ">>$wherelog$day" );