You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@apache.org on 2012/04/12 14:47:53 UTC
svn commit: r1325227 - /httpd/httpd/trunk/support/log_server_status.in
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" );