PHP idate() Functie
Voorbeeld
Maak een lokale tijd/datum op als geheel getal. Test alle verschillende formaten:
<?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>";
?>
Definitie en gebruik
De functie idate() maakt een lokale tijd en/of datum op als geheel getal.
Opmerking: de functie idate() accepteert slechts één teken in de formaatparameter !
Syntaxis
idate(format, timestamp)
Parameterwaarden
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()) |
Technische details
Winstwaarde: | Retourneert een geheel getal geformatteerd volgens het opgegeven formaat met behulp van de opgegeven tijdstempel |
---|---|
PHP-versie: | 5+ |
PHP-wijzigingslogboek: | PHP 5.1: geeft nu E_STRICT- en E_NOTICE-tijdzonefouten |
❮ PHP Datum/Tijd Referentie