Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
Класс Date
+ Граф наследования:Date:

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

 __construct ($date=null, $format=null)
 
 format ($format)
 
 __clone ()
 
 add ($interval)
 
 setDate ($year, $month, $day)
 
 getTimestamp ()
 
 getDiff (Date $time)
 
 toString (Context\Culture $culture=null)
 
 __toString ()
 

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

static getFormat (Context\Culture $culture=null)
 
static convertFormatToPhp ($format)
 
static isCorrect ($time, $format=null)
 
static createFromPhp (\DateTime $datetime)
 
static createFromTimestamp ($timestamp)
 
static createFromText ($text)
 

Защищенные члены

 parse ($format, $time)
 

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

static getCultureFormat (Context\Culture $culture=null)
 

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

 $value
 

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

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

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

◆ __construct()

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

ObjectException

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

Методы

◆ __clone()

__clone ( )

Produces the copy of the object.

Возвращает
void

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

◆ __toString()

__toString ( )

Converts a date to the string with default culture format setting.

Возвращает
string

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

◆ add()

add ( $interval)

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'

Аргументы
string$intervalTime interval to add.
Возвращает
$this

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

◆ convertFormatToPhp()

static convertFormatToPhp ( $format)
static

Converts date format from culture to php format.

Аргументы
string$formatFormat string.
Возвращает
string

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

◆ createFromPhp()

static createFromPhp ( \DateTime $datetime)
static

Creates Date object from PHP \DateTime object.

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

Переопределяется в DateTime.

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

◆ createFromText()

static createFromText ( $text)
static

Creates Date object from Text (return array of result object) Examples: "end of next week", "tomorrow morning", "friday 25.10"

Аргументы
string$text
Возвращает
DateTime|null

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

◆ createFromTimestamp()

static createFromTimestamp ( $timestamp)
static

Creates Date object from Unix timestamp.

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

Переопределяется в DateTime.

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

◆ format()

format ( $format)

Formats date value to string.

Аргументы
string$formatPHP date format.
Возвращает
string

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

◆ getCultureFormat()

static getCultureFormat ( Context\Culture $culture = null)
staticprotected

Returns short date culture format.

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

Переопределяется в DateTime.

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

◆ getDiff()

getDiff ( Date $time)

Returns difference between dates.

Аргументы
Date$time
Возвращает
\DateInterval

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

◆ getFormat()

static getFormat ( Context\Culture $culture = null)
static

Returns a date format from the culture in the php format.

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

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

◆ getTimestamp()

getTimestamp ( )

Returns Unix timestamp from date.

Возвращает
int

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

◆ isCorrect()

static isCorrect ( $time,
$format = null )
static

Checks the string for correct date (by trying to create Date object).

Аргументы
string$timeString representation of date.
string$formatPHP date format. If not specified, the format is got from the current culture.
Возвращает
bool

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

◆ parse()

parse ( $format,
$time )
protected
Аргументы
string$format
string$time
Возвращает
array|bool

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

◆ setDate()

setDate ( $year,
$month,
$day )

Sets the current date of the DateTime object to a different date.

Аргументы
int$year
int$month
int$day
Возвращает
$this

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

◆ toString()

toString ( Context\Culture $culture = null)

Converts a date to the string.

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

Переопределяется в DateTime.

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

Данные класса

◆ $value

$value
protected

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