1 | <?php |
||
11 | class RoundDate |
||
12 | { |
||
13 | /** |
||
14 | * @param \DateTime $date |
||
15 | * @param int $seconds |
||
16 | * |
||
17 | * @return \DateTime |
||
18 | */ |
||
19 | 10 | public static function round(\DateTime $date, $seconds) |
|
23 | |||
24 | /** |
||
25 | * @param \DateTime $date |
||
26 | * @param int $seconds |
||
27 | * |
||
28 | * @return \DateTime |
||
29 | */ |
||
30 | 10 | public static function floor(\DateTime $date, $seconds) |
|
35 | |||
36 | /** |
||
37 | * @param \DateTime $date |
||
38 | * @param int $seconds |
||
39 | * |
||
40 | * @return \DateTime |
||
41 | */ |
||
42 | 10 | public static function ceil(\DateTime $date, $seconds) |
|
46 | |||
47 | /** |
||
48 | * @param \DateTime $date |
||
49 | * @param int $uts |
||
50 | * |
||
51 | * @return \DateTime |
||
52 | */ |
||
53 | 30 | private static function setTimestamp(\DateTime $date, $uts) |
|
59 | } |
||
60 |