1 | <?php |
||
20 | class DateTimeHelper |
||
21 | { |
||
22 | private const INTERNAL_DATE_FORMAT = 'Y-m-d'; |
||
23 | |||
24 | /** |
||
25 | * @param \DateTimeZone|null $timeZone |
||
26 | * |
||
27 | * @return \DateTime |
||
28 | */ |
||
29 | public function getCurrentDatetime(?\DateTimeZone $timeZone = null): \DateTime |
||
33 | |||
34 | /** |
||
35 | * @param \DateTimeZone|null $timeZone |
||
36 | * |
||
37 | * @return \DateTimeImmutable |
||
38 | */ |
||
39 | public function getCurrentDatetimeImmutable(?\DateTimeZone $timeZone = null): \DateTimeImmutable |
||
43 | |||
44 | /** |
||
45 | * @param DateRange $dateRange |
||
46 | * |
||
47 | * @return \DateTimeImmutable[] |
||
48 | */ |
||
49 | public function getDatesFromDateRangeAsArrayOfObjects(DateRange $dateRange): array |
||
71 | |||
72 | /** |
||
73 | * @param DateRange $dateRange |
||
74 | * |
||
75 | * @return string[] |
||
76 | */ |
||
77 | public function getDatesFromDateRangeAsArrayOfString(DateRange $dateRange): array |
||
88 | } |
||
89 |