diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 1a151c4a70..2f6db2f566 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -2882,7 +2882,7 @@ sub cron_valid_date { my $utime; eval { local $SIG{__DIE__} = sub {}; - $utime = timelocal(0, $min, $hour, $mday, $month, $year); + $utime = strftime("%s", 0, $min, $hour, $mday, $month, $year); }; if ($@) { return 0; diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 67399f8e46..4deb6a7420 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -3825,7 +3825,7 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$$) { # Check time threshold $alert->{'last_fired'} = '1970-01-01 00:00:00' unless defined ($alert->{'last_fired'}); return unless ($alert->{'last_fired'} =~ /(\d+)\-(\d+)\-(\d+) +(\d+):(\d+):(\d+)/); - my $last_fired = ($1 > 0) ? timelocal($6, $5, $4, $3, $2 - 1, $1 - 1900) : 0; + my $last_fired = ($1 > 0) ? strftime("%s", $6, $5, $4, $3, $2 - 1, $1 - 1900) : 0; my $utimestamp = time (); my $timestamp = strftime ("%Y-%m-%d %H:%M:%S", localtime($utimestamp)); diff --git a/pandora_server/util/pandora_database_check.pl b/pandora_server/util/pandora_database_check.pl index 3d92911df4..2730f50371 100755 --- a/pandora_server/util/pandora_database_check.pl +++ b/pandora_server/util/pandora_database_check.pl @@ -216,7 +216,7 @@ sub process_module_data ($$$$$$$$$) { $timestamp !~ /(\d+)\-(\d+)\-(\d+) +(\d+):(\d+):(\d+)/) { } my $utimestamp; - $utimestamp = timelocal($6, $5, $4, $3, $2 - 1, $1 - 1900); + $utimestamp = strftime("%s", $6, $5, $4, $3, $2 - 1, $1 - 1900); my %data_object; diff --git a/pandora_server/util/pandora_xml_stress.pl b/pandora_server/util/pandora_xml_stress.pl index 69bec80e04..7d3e580d0d 100644 --- a/pandora_server/util/pandora_xml_stress.pl +++ b/pandora_server/util/pandora_xml_stress.pl @@ -112,13 +112,13 @@ sub generate_xml_files ($$$$$$) { my $time_from = get_conf_token ($conf, 'time_from', $time_now); die ("[error] Invalid time_from: $time_from\n\n") unless ($time_from =~ /(\d+)\-(\d+)\-(\d+) +(\d+):(\d+):(\d+)/); - my $utimestamp_from = timelocal($6, $5, $4, $3, $2 - 1, $1 - 1900); + my $utimestamp_from = strftime("%s", $6, $5, $4, $3, $2 - 1, $1 - 1900); # Get time_to my $time_to = get_conf_token ($conf, 'time_to', $time_now); die ("[error] Invalid time_to: $time_to\n\n") unless ($time_to =~ /(\d+)\-(\d+)\-(\d+) +(\d+):(\d+):(\d+)/); - my $utimestamp_to = timelocal($6, $5, $4, $3, $2 - 1, $1 - 1900); + my $utimestamp_to = strftime("%s", $6, $5, $4, $3, $2 - 1, $1 - 1900); my %modules_src_pointers = init_src_pointers($modules);