DateHelper
- Full name:
\boundstate\events\helpers\DateHelper
- This class is an Abstract class
Methods
setTime
public static setTime(\DateTimeInterface $date, \DateTimeInterface $time): \DateTime
- This method is static.
Parameters:
| Parameter |
Type |
Description |
$date |
\DateTimeInterface |
|
$time |
\DateTimeInterface |
|
endOfDay
public static endOfDay(\DateTimeInterface $date): \DateTime
- This method is static.
Parameters:
| Parameter |
Type |
Description |
$date |
\DateTimeInterface |
|
public static formatDate(\DateTimeInterface $startDate, ?string $format = 'medium', ?string $timezone = null): string
- This method is static.
Parameters:
| Parameter |
Type |
Description |
$startDate |
\DateTimeInterface |
|
$format |
?string |
|
$timezone |
?string |
|
public static formatDateRange(\DateTimeInterface $startDate, ?\DateTimeInterface $endDate, ?string $format = 'medium', ?string $timezone = null): string
- This method is static.
Parameters:
| Parameter |
Type |
Description |
$startDate |
\DateTimeInterface |
|
$endDate |
?\DateTimeInterface |
|
$format |
?string |
|
$timezone |
?string |
|
public static formatDatetimeRange(\DateTimeInterface $startDate, \DateTimeInterface $endDate, ?string $format = 'medium', ?string $timezone = null): string
- This method is static.
Parameters:
| Parameter |
Type |
Description |
$startDate |
\DateTimeInterface |
|
$endDate |
\DateTimeInterface |
|
$format |
?string |
|
$timezone |
?string |
|
public static formatTimeRange(\DateTimeInterface $startDate, \DateTimeInterface $endDate, ?string $format = 'medium', ?string $timezone = null): string
- This method is static.
Parameters:
| Parameter |
Type |
Description |
$startDate |
\DateTimeInterface |
|
$endDate |
\DateTimeInterface |
|
$format |
?string |
|
$timezone |
?string |
|