marsadm: fix call of localtime() in old perl versions

This commit is contained in:
Thomas Schoebel-Theuer 2014-01-17 08:53:59 +01:00
parent 59d141c06e
commit 07bd8db714

View File

@ -585,7 +585,8 @@ sub get_peers {
sub __conv_tv {
my ($tv_sec, $tv_nsec) = @_;
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($tv_sec);
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(int($tv_sec));
return "$tv_sec.$tv_nsec" unless defined($sec);
return sprintf("%04d-%02d-%02d %02d:%02d:%02d.%s", $year+1900, $mon + 1, $mday, $hour, $min, $sec, $tv_nsec);
}