| @@ 87-98 (lines=12) @@ | ||
| 84 | * @return string |
|
| 85 | * @throws \Exception |
|
| 86 | */ |
|
| 87 | public function startOfDay($date = null) |
|
| 88 | { |
|
| 89 | $now = clone $this->dateTimeProvider->get(); |
|
| 90 | ||
| 91 | if ($date) { |
|
| 92 | $now = $this->modifyDate($now, $date); |
|
| 93 | } |
|
| 94 | ||
| 95 | $now->setTime(0, 0, 0); |
|
| 96 | ||
| 97 | return $now->format(\DateTime::ISO8601); |
|
| 98 | } |
|
| 99 | ||
| 100 | /** |
|
| 101 | * Gets a date with the hour 23:59:59 |
|
| @@ 108-119 (lines=12) @@ | ||
| 105 | * @return string |
|
| 106 | * @throws \Exception |
|
| 107 | */ |
|
| 108 | public function endOfDay($date = null) |
|
| 109 | { |
|
| 110 | $now = clone $this->dateTimeProvider->get(); |
|
| 111 | ||
| 112 | if ($date) { |
|
| 113 | $now = $this->modifyDate($now, $date); |
|
| 114 | } |
|
| 115 | ||
| 116 | $now->setTime(23, 59, 59); |
|
| 117 | ||
| 118 | return $now->format(\DateTime::ISO8601); |
|
| 119 | } |
|
| 120 | ||
| 121 | /** |
|
| 122 | * Gets the current users' username |
|