Skip to content

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

formatDate

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

formatDateRange

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

formatDatetimeRange

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

formatTimeRange

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