Funkce PHP date_isodate_set().
Příklad
Nastavte datum ISO na 5. týden v roce 2013:
<?php
$date=date_create();
date_isodate_set($date,2013,5);
echo date_format($date,"Y-m-d");
?>
Definice a použití
Funkce date_isodate_set() nastavuje datum podle normy ISO 8601 pomocí posunů týdnů a dnů (místo použití konkrétního data).
Syntax
date_isodate_set(object, year, week, day)
Hodnoty parametrů
Parameter | Description |
---|---|
object | Required. Specifies a DateTime object returned by date_create() |
year | Required. Specifies the year of the date |
week | Required. Specifies the week of the date |
day | Optional. Specifies the offset from the first day of the week. Default is 1 |
Technické údaje
Návratová hodnota: | Při úspěchu vrátí objekt DateTime. NEPRAVDA při selhání |
---|---|
Verze PHP: | 5,2+ |
PHP Changelog: | PHP 5.3: Změněna návratová hodnota z NULL na DateTime |
❮ Reference data/času PHP