Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Commit

Permalink
manage time stamp identification failure
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhemmarchand committed Jun 4, 2017
1 parent 8fca65d commit 423fa60
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion TA-nmon/bin/nmon2csv.pl
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,10 @@
# - 04/01/2017: V1.2.34: Guilhem Marchand: Update path discovery
# - 05/23/2017: V1.2.35: Guilhem Marchand: Adding the fifo mode with an adapted management to the fifo configuration
# - 05/29/2017: V1.2.36: Guilhem Marchand: Several fixes in fifo implementation
# - 06/03/2017: V1.2.37: Guilhem Marchand: Manage time stamp identification failure, produce error message and affect
# current timestmap in case of failure

$version = "1.2.36";
$version = "1.2.37";

use Time::Local;
use Time::HiRes;
Expand Down Expand Up @@ -2774,6 +2776,15 @@ sub variable_sections_insert {

# Convert timestamp string to epoch time (from format: YYYY-MM-DD hh:mm:ss)
my ( $year, $month, $day, $hour, $min, $sec ) = split /\W+/, $timestamp;

if ($month == 0) {
print "ERROR, section $key has failed to identify the timestamp of these data, affecting current
timestamp which may be inaccurate";
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$month = $mon;
$day = $mday;
}

my $ZZZZ_epochtime =
timelocal( $sec, $min, $hour, $day, $month - 1, $year );

Expand Down

0 comments on commit 423fa60

Please sign in to comment.