PHP » PYTHON |
login |
register |
about
|
PYTHON localtime
is this article helpful?
|
Python replacement for PHP's localtime
[
edit
| history
]
import time result = time.localtime() result = time.localtime(timestamp) localtime(PHP 4, PHP 5) localtime — Get the local time Description
array localtime
([ int $timestamp= time()
[, bool $is_associative= false
]] )
The localtime() function returns an array identical to that of the structure returned by the C function call. Parameters
Errors/ExceptionsEvery call to a date/time function will generate a E_NOTICE if the time zone is not valid, and/or a E_STRICT message if using the system settings or the TZ environment variable. See also date_default_timezone_set() Changelog
Examples
Example #1 localtime() example
<?phpThe above example will output something similar to:
Array
(
[0] => 24
[1] => 3
[2] => 19
[3] => 3
[4] => 3
[5] => 105
[6] => 0
[7] => 92
[8] => 1
)
Array
(
[tm_sec] => 24
[tm_min] => 3
[tm_hour] => 19
[tm_mday] => 3
[tm_mon] => 3
[tm_year] => 105
[tm_wday] => 0
[tm_yday] => 92
[tm_isdst] => 1
)
|
more
Recently updated
more
Most requested
|