httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rbo...@apache.org
Subject svn commit: r1325227 - /httpd/httpd/trunk/support/log_server_status.in
Date Thu, 12 Apr 2012 12:47:53 GMT
Author: rbowen
Date: Thu Apr 12 12:47:53 2012
New Revision: 1325227

URL: http://svn.apache.org/viewvc?rev=1325227&view=rev
Log:
Removes calls to `date`.

Modified:
    httpd/httpd/trunk/support/log_server_status.in

Modified: httpd/httpd/trunk/support/log_server_status.in
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/support/log_server_status.in?rev=1325227&r1=1325226&r2=1325227&view=diff
==============================================================================
--- httpd/httpd/trunk/support/log_server_status.in (original)
+++ httpd/httpd/trunk/support/log_server_status.in Thu Apr 12 12:47:53 2012
@@ -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" );
 



Mime
View raw message