Funzione PHP idate()
Esempio
Formatta un'ora/data locale come numero intero. Prova tutti i diversi formati:
<?php
echo idate("B") . "<br>";
echo idate("d") . "<br>";
echo idate("h") . "<br>";
echo idate("H") . "<br>";
echo idate("i") . "<br>";
echo idate("I") . "<br>";
echo idate("L") . "<br>";
echo idate("m") . "<br>";
echo idate("s") . "<br>";
echo idate("t") . "<br>";
echo idate("U") . "<br>";
echo idate("w") . "<br>";
echo idate("W") . "<br>";
echo idate("y") . "<br>";
echo idate("Y") . "<br>";
echo idate("z") . "<br>";
echo idate("Z") . "<br>";
?>
Definizione e utilizzo
La funzione idate() formatta un'ora locale e/o una data come intero.
Nota: la funzione idate() accetta solo un carattere nel parametro format !
Sintassi
idate(format, timestamp)
Valori dei parametri
Parameter | Description |
---|---|
format | Required. Specifies how to return the result. One of the following
characters is allowed:
|
timestamp | Optional. Specifies a Unix timestamp that represents the date and/or time to be formatted. Default is the current local time (time()) |
Dettagli tecnici
Valore di ritorno: | Restituisce un numero intero formattato in base al formato specificato utilizzando il timestamp specificato |
---|---|
Versione PHP: | 5+ |
Registro delle modifiche PHP: | PHP 5.1: ora emette errori di fuso orario E_STRICT e E_NOTICE |
❮ Riferimento di data/ora PHP