Class humhub\libs\DateTimeHelper

Inheritancehumhub\libs\DateTimeHelper

DateTimeHelper

Public Methods

Hide inherited methods

MethodDescriptionDefined By
convertDateIntervalToSeconds() Converts a DateInterval object into seconds humhub\libs\DateTimeHelper
getDateInterval() Converts two given DateTime instances or strings into a DateInterval humhub\libs\DateTimeHelper
getTimeFormat() humhub\libs\DateTimeHelper
roundToNextFullHour() Rounds given DateTime object to the next full hour humhub\libs\DateTimeHelper

Method Details

convertDateIntervalToSeconds() public static method

Converts a DateInterval object into seconds

public static integer convertDateIntervalToSeconds ( DateInterval $interval )
$interval DateInterval
return integer

The seconds

getDateInterval() public static method

Converts two given DateTime instances or strings into a DateInterval

public static DateInterval getDateInterval ( $startDateTime null, $endDateTime )
$startDateTime DateTime|string|null

The start date or null for current date time

$endDateTime DateTime

The end date time

getTimeFormat() public static method

public static void getTimeFormat ( )
roundToNextFullHour() public static method

Rounds given DateTime object to the next full hour

public static DateTime roundToNextFullHour ( DateTime $dateTime null )
$dateTime DateTime