Abstract Class DateHelper
Methods
setTime
Returns a new DateTime object with the time set to the given time.
public static setTime(DateTimeInterface $date, DateTimeInterface $time): DateTime
|
|
|
$date |
DateTimeInterface |
|
$time |
DateTimeInterface |
|
| return |
DateTime |
|
endOfDay
Returns a new DateTime object with the time set to the end of the day.
public static endOfDay(DateTimeInterface $date): DateTime
|
|
|
$date |
DateTimeInterface |
|
| return |
DateTime |
|
public static formatDate(DateTimeInterface $startDate, "medium"|"long" $format = 'medium', ?string $timezone = null): string
|
|
|
$startDate |
DateTimeInterface |
|
$format |
"medium"|"long" |
|
$timezone |
?string |
|
| return |
string |
|
public static formatDateRange(DateTimeInterface $startDate, ?DateTimeInterface $endDate, "medium"|"long" $format = 'medium', ?string $timezone = null): string
|
|
|
$startDate |
DateTimeInterface |
|
$endDate |
?DateTimeInterface |
|
$format |
"medium"|"long" |
|
$timezone |
?string |
|
| return |
string |
|
public static formatDatetimeRange(DateTimeInterface $startDate, DateTimeInterface $endDate, string $format = 'medium', ?string $timezone = null): string
|
|
|
$startDate |
DateTimeInterface |
|
$endDate |
DateTimeInterface |
|
$format |
string |
|
$timezone |
?string |
|
| return |
string |
|
public static formatTimeRange(DateTimeInterface $startDate, DateTimeInterface $endDate, ?string $format = 'medium', ?string $timezone = null): string
|
|
|
$startDate |
DateTimeInterface |
|
$endDate |
DateTimeInterface |
|
$format |
?string |
|
$timezone |
?string |
|
| return |
string |
|