См. определение в файле date.php строка 8
◆ __construct()
__construct |
( |
|
$date = null , |
|
|
|
$format = null |
|
) |
| |
- Аргументы
-
string | null | $date | String representation of date. |
string | null | $format | PHP date format. If not specified, the format is got from the current culture. |
- Исключения
-
ObjectException
См. определение в файле date.php строка 19
◆ __clone()
Produces the copy of the object.
- Возвращает
- void
См. определение в файле date.php строка 120
◆ __toString()
Converts a date to the string with default culture format setting.
- Возвращает
- string
См. определение в файле date.php строка 249
◆ add()
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 | $interval | Time interval to add. |
- Возвращает
- $this
См. определение в файле date.php строка 145
◆ convertFormatToPhp()
static convertFormatToPhp |
( |
|
$format | ) |
|
|
static |
Converts date format from culture to php format.
- Аргументы
-
string | $format | Format string. |
- Возвращает
- string
См. определение в файле date.php строка 306
◆ createFromPhp()
static createFromPhp |
( |
\DateTime |
$datetime | ) |
|
|
static |
Creates Date object from PHP \DateTime object.
- Аргументы
-
\DateTime | $datetime | Source 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"
- Аргументы
-
- Возвращает
- DateTime|null
См. определение в файле date.php строка 414
◆ createFromTimestamp()
static createFromTimestamp |
( |
|
$timestamp | ) |
|
|
static |
Creates Date object from Unix timestamp.
- Аргументы
-
int | $timestamp | Source timestamp. |
- Возвращает
- static
Переопределяется в DateTime.
См. определение в файле date.php строка 399
◆ format()
Formats date value to string.
- Аргументы
-
string | $format | PHP date format. |
- Возвращает
- string
См. определение в файле date.php строка 110
◆ getCultureFormat()
Returns short date culture format.
- Аргументы
-
Context\Culture | null | $culture | Culture. |
- Возвращает
- string
Переопределяется в DateTime.
См. определение в файле date.php строка 290
◆ getDiff()
Returns difference between dates.
- Аргументы
-
- Возвращает
- \DateInterval
См. определение в файле date.php строка 226
◆ getFormat()
Returns a date format from the culture in the php format.
- Аргументы
-
Context\Culture | null | $culture | Optional culture. |
- Возвращает
- string
См. определение в файле date.php строка 261
◆ 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 | $time | String representation of date. |
string | $format | PHP date format. If not specified, the format is got from the current culture. |
- Возвращает
- bool
См. определение в файле date.php строка 356
◆ parse()
- Аргументы
-
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()
Converts a date to the string.
- Аргументы
-
Context\Culture | null | $culture | Culture contains date format. |
- Возвращает
- string
Переопределяется в DateTime.
См. определение в файле date.php строка 238
◆ $value