Made sure parsetime returns seconds as integer

This commit is contained in:
pezcurrel 2024-01-02 01:08:14 +01:00
parent 091a7785b2
commit efc6f2f79f

View file

@ -6,6 +6,7 @@ function parsetime($str) {
foreach ($str as $ent) {
if (preg_match('/^(\d+)([smhdwMy])$/',$ent,$mat)!==1)
return(false);
$mat[1]+=0;
if ($mat[2]=='s')
$secs+=$mat[1];
elseif ($mat[2]=='m')
@ -21,7 +22,7 @@ function parsetime($str) {
elseif ($mat[2]=='y')
$secs+=$mat[1]*60*60*24*365;
}
return($secs);
return $secs;
}
?>