/**
* @param string | null $time String representation of datetime.
* @param string | null $format PHP datetime format. If not specified, the format is got from the current culture.
* @param \DateTimeZone | null $timezone Optional timezone object.
*
* @throws Main\ObjectException
*/
Defined in <ROOT>/bitrix/modules/main/lib/type/datetime.php:20
⇄⧉public toString(Bitrix\Main\Context\Culture $culture = null): string Converts date to string, using Culture and global timezone settings.
/**
* Converts date to string, using Culture and global timezone settings.
*
* @param Context\Culture | null $culture Culture contains datetime format.
*
* @return string
*/
Defined in <ROOT>/bitrix/modules/main/lib/type/datetime.php:86
/**
* @param int $hour Hour value.
* @param int $minute Minute value.
* @param int $second Second value.
* @param int $microseconds Microseconds value.
*
* @return DateTime
*/
Defined in <ROOT>/bitrix/modules/main/lib/type/datetime.php:144
⇄⧉public toUserTime(): DateTime Changes time from server time to user time using global timezone settings.
/**
* Changes time from server time to user time using global timezone settings.
*
* @return DateTime
*/
Defined in <ROOT>/bitrix/modules/main/lib/type/datetime.php:155
/**
* Formats date value to string.
*
* @param string $format PHP date format.
*
* @return string
*/
Inherited from Bitrix\Main\Type\Date
Defined in <ROOT>/bitrix/modules/main/lib/type/date.php:110
⇄⧉public __clone(): void Produces the copy of the object.
/**
* Produces the copy of the object.
*
* @return void
*/
Inherited from Bitrix\Main\Type\Date
Defined in <ROOT>/bitrix/modules/main/lib/type/date.php:120
/**
* Performs dates arithmetic.
*
* Each duration period is represented by an integer value followed by a period
* designator. If the duration contains time elements, that portion of the
* specification is preceded by the letter T.
* Period Designators: Y - years, M - months, D - days, W - weeks, H - hours,
* M - minutes, S - seconds.
* Examples: two days - 2D, two seconds - T2S, six years and five minutes - 6YT5M.
* The unit types must be entered from the largest scale unit on the left to the
* smallest scale unit on the right.
* Use first "-" char for negative periods.
* OR
* Relative period.
* Examples: "+5 weeks", "12 day", "-7 weekdays", '3 months - 5 days'
*
* @param string $interval Time interval to add.
*
* @return $this
*/
Inherited from Bitrix\Main\Type\Date
Defined in <ROOT>/bitrix/modules/main/lib/type/date.php:145
⇄⧉public setDate($year, $month, $day): $this Sets the current date of the DateTime object to a different date.
/**
* Sets the current date of the DateTime object to a different date.
* @param int $year
* @param int $month
* @param int $day
*
* @return $this
*/
Inherited from Bitrix\Main\Type\Date
Defined in <ROOT>/bitrix/modules/main/lib/type/date.php:166
⇄⧉public getTimestamp(): int Returns Unix timestamp from date.
/**
* Returns Unix timestamp from date.
*
* @return int
*/
Inherited from Bitrix\Main\Type\Date
Defined in <ROOT>/bitrix/modules/main/lib/type/date.php:215
⇄⧉public getDiff(Bitrix\Main\Type\Date $time): \DateInterval Returns difference between dates.
/**
* Returns difference between dates.
*
* @param Date $time
* @return \DateInterval
*/
Inherited from Bitrix\Main\Type\Date
Defined in <ROOT>/bitrix/modules/main/lib/type/date.php:226
⇄⧉public __toString(): string Converts a date to the string with default culture format setting.
/**
* Converts a date to the string with default culture format setting.
*
* @return string
*/
Inherited from Bitrix\Main\Type\Date
Defined in <ROOT>/bitrix/modules/main/lib/type/date.php:249
Defined in <ROOT>/bitrix/modules/main/lib/type/datetime.php:71
⇄⧉public static createFromUserTime($timeString): DateTime Creates DateTime object from local user time using global timezone settings and ...
/**
* Creates DateTime object from local user time using global timezone settings and default culture.
*
* @param string $timeString Full or short formatted time.
*
* @return DateTime
*/
Defined in <ROOT>/bitrix/modules/main/lib/type/datetime.php:180
/**
* Creates DateTime object from Unix timestamp.
*
* @param int $timestamp Source timestamp.
*
* @return static
*/
Defined in <ROOT>/bitrix/modules/main/lib/type/datetime.php:246
⇄⧉public static tryParse($timeString, $format = null): DateTime|null Creates DateTime object from string. NULL will be returned on failure.
/**
* Creates DateTime object from string.
* NULL will be returned on failure.
* @param string $timeString Full formatted time.
* @param string $format PHP datetime format. If not specified, the format is got from the current culture.
* @return DateTime|null
*/
Defined in <ROOT>/bitrix/modules/main/lib/type/datetime.php:260
⇄⧉public static getFormat(Bitrix\Main\Context\Culture $culture = null): string Returns a date format from the culture in the php format.
/**
* Returns a date format from the culture in the php format.
*
* @param Context\Culture | null $culture Optional culture.
*
* @return string
*/
Inherited from Bitrix\Main\Type\Date
Defined in <ROOT>/bitrix/modules/main/lib/type/date.php:261
⇄⧉public static convertFormatToPhp($format): string Converts date format from culture to php format.
/**
* Converts date format from culture to php format.
*
* @param string $format Format string.
*
* @return string
*/
Inherited from Bitrix\Main\Type\Date
Defined in <ROOT>/bitrix/modules/main/lib/type/date.php:306
⇄⧉public static isCorrect($time, $format = null): bool Checks the string for correct date (by trying to create Date object).
/**
* Checks the string for correct date (by trying to create Date object).
*
* @param string $time String representation of date.
* @param string $format PHP date format. If not specified, the format is got from the current culture.
*
* @return bool
*/
Inherited from Bitrix\Main\Type\Date
Defined in <ROOT>/bitrix/modules/main/lib/type/date.php:356
⇄⧉public static createFromText($text): DateTime|null Creates Date object from Text (return array of result object) Examples: "end of ...
\Bitrix\Main\Type\Date::createFromText($text)
/**
* Creates Date object from Text (return array of result object)
* Examples: "end of next week", "tomorrow morning", "friday 25.10"
*
* @param string $text
* @return DateTime|null
*/
Inherited from Bitrix\Main\Type\Date
Defined in <ROOT>/bitrix/modules/main/lib/type/date.php:414
⧉protected static getCultureFormat(Bitrix\Main\Context\Culture $culture = null): string Returns long (including time) date culture format.
/**
* Returns long (including time) date culture format.
*
* @param Context\Culture | null $culture Culture.
*
* @return string
*/
Defined in <ROOT>/bitrix/modules/main/lib/type/datetime.php:216