1 | <?php |
||
22 | class DateTimeHelper |
||
23 | { |
||
24 | private const INTERNAL_DATE_FORMAT = 'Y-m-d'; |
||
25 | |||
26 | /** |
||
27 | * @param \DateTimeZone|null $timeZone |
||
28 | * |
||
29 | * @return \DateTime |
||
30 | */ |
||
31 | public function getCurrentDatetime(?\DateTimeZone $timeZone = null): \DateTime |
||
35 | |||
36 | /** |
||
37 | * @param \DateTimeZone|null $timeZone |
||
38 | * |
||
39 | * @return \DateTimeImmutable |
||
40 | */ |
||
41 | public function getCurrentDatetimeImmutable(?\DateTimeZone $timeZone = null): \DateTimeImmutable |
||
45 | |||
46 | /** |
||
47 | * @param DateRange $dateRange |
||
48 | * |
||
49 | * @throws UnexpectedValueException |
||
50 | * |
||
51 | * @return \DateTimeImmutable[] |
||
52 | */ |
||
53 | public function getDatesFromDateRangeAsArrayOfObjects(DateRange $dateRange): array |
||
81 | |||
82 | /** |
||
83 | * @param DateRange $dateRange |
||
84 | * |
||
85 | * @return string[] |
||
86 | */ |
||
87 | public function getDatesFromDateRangeAsArrayOfStrings(DateRange $dateRange): array |
||
98 | } |
||
99 |