Class humhub\libs\DateHelper

Inheritancehumhub\libs\DateHelper

Utility class for date issues

See also \yii\validators\DateValidator.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
parseDateTime() Parses a date and optionally a time if timeAttribute is specified to an given pattern or the default pattern 'Y-m-d' if no pattern is provided. humhub\libs\DateHelper
parseDateTimeToTimestamp() Parses a date and optionally a time if timeAttribute is specified. humhub\libs\DateHelper

Method Details

parseDateTime() public static method

Parses a date and optionally a time if timeAttribute is specified to an given pattern or the default pattern 'Y-m-d' if no pattern is provided.

public static integer parseDateTime ( $value, $pattern 'Y-m-d', $timeValue null )
$value string

Date value

$pattern string

Pattern

$timeValue string

Optional time value

return integer

Timestamp in utc

parseDateTimeToTimestamp() public static method

Parses a date and optionally a time if timeAttribute is specified.

public static integer parseDateTimeToTimestamp ( $value, $timeValue null )
$value string
$timeValue string

Optional time value

return integer

Timestamp in utc