i found that in software.pm , there it validation on the $software->{INSTALLDATE} and it expect it data to be in the format YYYY-MM-DD hh:mm:ss if it not it will reset the variable $software->{INSTALLDATE} to localtime $software->{INSTALLDATE} = strftime "%Y/%m/%d", localtime;
but currently some agent generate the date as DD/MM/YYYY and on windows, some application does output the date in correct format but does not has timestamp.
can we update the validation to include date in the format DD/MM/YYYY and convert it to YYYY/MM/DD
# Check if Install date is in the format DD/MM/YYYY and reformat in YYYY/MM/DD
if(!defined $software->{INSTALLDATE} || $software->{INSTALLDATE} =~ /^\d{2}\/\d{2}\/\d{4}/) {
$software->{INSTALLDATE} =~ s /(^\d{2})\/(\d{2})\/(\d{4}$)/$3\/$2\/$1/;
}
The problem with this change is that we have no way of knowing if the date format is DD/MM/YYYY or MM/DD/YYYY.
Hence the fact that we cannot include this modification.
Server informations
Problem's description
For some CI, the software installdate is set to the currentdate instead of the date present in the XML.
here is an example of data from the XML generated by the unix agent 2.8.0
here is the date in OCS server
i found that in software.pm , there it validation on the
$software->{INSTALLDATE}
and it expect it data to be in the formatYYYY-MM-DD hh:mm:ss
if it not it will reset the variable$software->{INSTALLDATE}
to localtime$software->{INSTALLDATE} = strftime "%Y/%m/%d", localtime;
but currently some agent generate the date as
DD/MM/YYYY
and on windows, some application does output the date in correct format but does not has timestamp.can we update the validation to include date in the format
DD/MM/YYYY
and convert it toYYYY/MM/DD