PHP date_isodate_set() Funzione
Esempio
Imposta la data ISO sulla 5a settimana nel 2013:
<?php
$date=date_create();
date_isodate_set($date,2013,5);
echo date_format($date,"Y-m-d");
?>
Definizione e utilizzo
La funzione date_isodate_set() imposta una data secondo lo standard ISO 8601, utilizzando settimane e giorni (invece di utilizzare una data specifica).
Sintassi
date_isodate_set(object, year, week, day)
Valori dei parametri
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 |
Dettagli tecnici
Valore di ritorno: | Restituisce un oggetto DateTime in caso di successo. FALSO in caso di fallimento |
---|---|
Versione PHP: | 5.2+ |
Registro delle modifiche PHP: | PHP 5.3: modificato il valore restituito da NULL a DateTime |
❮ Riferimento di data/ora PHP