1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Класс DateTime
Граф наследования:DateTime:
Date

Открытые члены

 __construct ($time=null, $format=null, \DateTimeZone $timezone=null)
 toString (Context\Culture $culture=null)
 getTimeZone ()
 setTimeZone (\DateTimeZone $timezone)
 setDefaultTimeZone ()
 setTime ($hour, $minute, $second=0, $microseconds=0)
 toUserTime ()
 isUserTimeEnabled ()
 disableUserTime ()
 enableUserTime ()
Открытые члены унаследованные от Date
 __construct ($date=null, $format=null)
 format ($format)
 __clone ()
 add ($interval)
 setDate ($year, $month, $day)
 getTimestamp ()
 getDiff (Date $time)
 __toString ()

Открытые статические члены

static secondsToOffset ($seconds, $delimiter='')
static createFromUserTime ($timeString)
static createFromPhp (\DateTime $datetime)
static createFromTimestamp ($timestamp)
static tryParse ($timeString, $format=null)
Открытые статические члены унаследованные от Date
static getFormat (Context\Culture $culture=null)
static convertFormatToPhp ($format)
static isCorrect ($time, $format=null)
static createFromText ($text)

Защищенные статические члены

static getCultureFormat (Context\Culture $culture=null)

Защищенные данные

 $userTimeEnabled = true
Защищенные данные унаследованные от Date
 $value

Дополнительные унаследованные члены

Защищенные члены унаследованные от Date
 parse ($format, $time)

Подробное описание

См. определение в файле datetime.php строка 8

Конструктор(ы)

◆ __construct()

__construct ( $time = null,
$format = null,
\DateTimeZone $timezone = null )
Аргументы
string  |  null$timeString representation of datetime.
string  |  null$formatPHP datetime format. If not specified, the format is got from the current culture.
\DateTimeZone  |  null$timezoneOptional timezone object.
Исключения
Main

ObjectException

См. определение в файле datetime.php строка 20

Методы

◆ createFromPhp()

createFromPhp ( \DateTime $datetime)
static

Creates DateTime object from PHP \DateTime object.

Аргументы
\DateTime$datetimeSource object.
Возвращает
static

Переопределяет метод предка Date.

См. определение в файле datetime.php строка 232

◆ createFromTimestamp()

createFromTimestamp ( $timestamp)
static

Creates DateTime object from Unix timestamp.

Аргументы
int$timestampSource timestamp.
Возвращает
static

Переопределяет метод предка Date.

См. определение в файле datetime.php строка 246

◆ createFromUserTime()

createFromUserTime ( $timeString)
static

Creates DateTime object from local user time using global timezone settings and default culture.

Аргументы
string$timeStringFull or short formatted time.
Возвращает
DateTime

См. определение в файле datetime.php строка 180

◆ disableUserTime()

disableUserTime ( )
Возвращает
$this

См. определение в файле datetime.php строка 289

◆ enableUserTime()

enableUserTime ( )
Возвращает
$this

См. определение в файле datetime.php строка 299

◆ getCultureFormat()

getCultureFormat ( Context\Culture $culture = null)
staticprotected

Returns long (including time) date culture format.

Аргументы
Context\Culture  |  null$cultureCulture.
Возвращает
string

Переопределяет метод предка Date.

См. определение в файле datetime.php строка 216

◆ getTimeZone()

getTimeZone ( )

Returns timezone object.

Возвращает
\DateTimeZone

См. определение в файле datetime.php строка 106

◆ isUserTimeEnabled()

isUserTimeEnabled ( )
Возвращает
bool

См. определение в файле datetime.php строка 281

◆ secondsToOffset()

secondsToOffset ( $seconds,
$delimiter = '' )
static

См. определение в файле datetime.php строка 71

◆ setDefaultTimeZone()

setDefaultTimeZone ( )

Sets default timezone.

Возвращает
DateTime

См. определение в файле datetime.php строка 129

◆ setTime()

setTime ( $hour,
$minute,
$second = 0,
$microseconds = 0 )
Аргументы
int$hourHour value.
int$minuteMinute value.
int$secondSecond value.
int$microsecondsMicroseconds value.
Возвращает
DateTime

См. определение в файле datetime.php строка 144

◆ setTimeZone()

setTimeZone ( \DateTimeZone $timezone)

Sets timezone object.

Аргументы
\DateTimeZone$timezoneTimezone object.
Возвращает
DateTime

См. определение в файле datetime.php строка 118

◆ toString()

toString ( Context\Culture $culture = null)

Converts date to string, using Culture and global timezone settings.

Аргументы
Context\Culture  |  null$cultureCulture contains datetime format.
Возвращает
string

Переопределяет метод предка Date.

См. определение в файле datetime.php строка 86

◆ toUserTime()

toUserTime ( )

Changes time from server time to user time using global timezone settings.

Возвращает
DateTime

См. определение в файле datetime.php строка 155

◆ tryParse()

tryParse ( $timeString,
$format = null )
static

Creates DateTime object from string. NULL will be returned on failure.

Аргументы
string$timeStringFull formatted time.
string$formatPHP datetime format. If not specified, the format is got from the current culture.
Возвращает
DateTime|null

См. определение в файле datetime.php строка 260

Поля

◆ $userTimeEnabled

$userTimeEnabled = true
protected

См. определение в файле datetime.php строка 11


Объявления и описания членов класса находятся в файле: