Merge branch 'ent-12222-parametro-timezone_offset-dentro-de-conf-de-agente-no-afecta-timestamp-de-modulo' into 'develop'
#12222 Fix timezone offset when modules has timezone data See merge request artica/pandorafms!6854
This commit is contained in:
commit
ba82572d00
|
@ -627,6 +627,11 @@ sub process_xml_data ($$$$$) {
|
||||||
|
|
||||||
my $module_type = get_tag_value ($module_data, 'type', 'generic_data');
|
my $module_type = get_tag_value ($module_data, 'type', 'generic_data');
|
||||||
|
|
||||||
|
# Apply timezone offset to module if timestamp is set.
|
||||||
|
if (defined($module_data->{'timestamp'} && $module_data->{'timestamp'} ne '')) {
|
||||||
|
$module_data->{'timestamp'} = strftime ("%Y-%m-%d %H:%M:%S", localtime($module_data->{'timestamp'} + ($timezone_offset * 3600)));
|
||||||
|
}
|
||||||
|
|
||||||
# Single data
|
# Single data
|
||||||
if (! defined ($module_data->{'datalist'})) {
|
if (! defined ($module_data->{'datalist'})) {
|
||||||
my $data_timestamp = get_tag_value ($module_data, 'timestamp', $timestamp);
|
my $data_timestamp = get_tag_value ($module_data, 'timestamp', $timestamp);
|
||||||
|
|
Loading…
Reference in New Issue