mirror of https://github.com/MISP/MISP
chg: [decaying:simulation] Swapped round to floor when rounding
sightings timestamppull/5032/head
parent
1a5ab3e79e
commit
fbad1aaff3
|
@ -401,12 +401,12 @@ class DecayingModel extends AppModel
|
|||
}
|
||||
|
||||
// returns timestamp set to the rounded hour
|
||||
public function round_timestamp_to_hour($time, $closest=1)
|
||||
public function round_timestamp_to_hour($time, $floor=1)
|
||||
{
|
||||
if ($closest) {
|
||||
return round((float) $time / 3600) * 3600;
|
||||
} else {
|
||||
if ($floor) {
|
||||
return floor((float) $time / 3600) * 3600;
|
||||
} else {
|
||||
return round((float) $time / 3600) * 3600;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue