Skip to content

Commit 36e0539

Browse files
Peter Oberparleiteroberpar
authored andcommitted
genhtml: add time to date string
Add the current time to the date information in the HTML output generated by genhtml. This way users can differentiate results when creating HTML output multiple times a day. Based on patch by [email protected].
1 parent 38fbe93 commit 36e0539

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

bin/genhtml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ use Digest::MD5 qw(md5_base64);
7373

7474
# Global constants
7575
our $title = "LCOV - code coverage report";
76-
our $lcov_version = 'LCOV version 1.11 pre (CVS $Revision: 1.75 $)';
76+
our $lcov_version = 'LCOV version 1.11 pre (CVS $Revision: 1.76 $)';
7777
our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php";
7878
our $tool_name = basename($0);
7979

@@ -2588,10 +2588,15 @@ sub get_date_string()
25882588
my $year;
25892589
my $month;
25902590
my $day;
2591+
my $hour;
2592+
my $min;
2593+
my $sec;
25912594

2592-
($year, $month, $day) = (localtime())[5, 4, 3];
2595+
($year, $month, $day, $hour, $min, $sec) =
2596+
(localtime())[5, 4, 3, 2, 1, 0];
25932597

2594-
return sprintf("%d-%02d-%02d", $year+1900, $month+1, $day);
2598+
return sprintf("%d-%02d-%02d %02d:%02d:%02d", $year+1900, $month+1,
2599+
$day, $hour, $min, $sec);
25952600
}
25962601

25972602

0 commit comments

Comments
 (0)