PHP localtime() Funksie
Voorbeeld
Druk plaaslike tyd as 'n geïndekseer en as 'n assosiatiewe skikking:
<?php
print_r(localtime());
echo "<br><br>";
print_r(localtime(time(),true));
?>
Definisie en gebruik
Die localtime()-funksie gee die plaaslike tyd terug.
Sintaksis
localtime(timestamp, is_assoc)
Parameterwaardes
Parameter | Description |
---|---|
timestamp | Optional. Specifies a Unix timestamp that defaults to the current local time, time(), if no timestamp is specified |
is_assoc | Optional. Specifies whether to return an associative or indexed array. FALSE = the array returned is an indexed array. TRUE = the array returned is an associative array. FALSE is default.
The keys of the associative array are:
|
Tegniese besonderhede
Terugkeerwaarde: | Wys 'n skikking wat die komponente van 'n Unix-tydstempel bevat |
---|---|
PHP weergawe: | 4+ |
PHP Changelog: | PHP 5.1: Reik nou E_STRICT en E_NOTICE tydsonefoute uit |
❮ PHP Datum/Tyd Verwysing