<?php
arr localtime ( int|null $timestamp = null , bool $associative = false )
where,
$timestamp = The UNIX timestamp
$associative = To control the format of the returned ARRAY
?>
KEY | DESCRIPTION | EXAMPLE RETURNED |
tm_sec | Numeric representation of seconds | 0 to 59 |
tm_min | Numeric representation of minutes | 0 to 59 |
tm_hour | Numeric representation of hours | 0 to 23 |
tm_mday | Numeric representation of the day of the month | 1 to 31 |
tm_wday | Numeric representation of the day of the week | 0 for Sunday... 6 for Saturday |
tm_mon | Numeric representation of a month | 0 for January to 11 for December |
tm_year | Value to be added to 1900 | The year |
tm_yday | Numeric representation of the day of the year | 0 to 365 |
tm_isdst | DST | ZERO |
OUT DST | less than ZERO | |
ed48 |
<table width="100%" cellspacing="5" cellpadding="5"
border="1" align="center"><tbody>
<tr><td colspan="2">REGULAR NUMERICALY INDEXED ARRAY</td></tr><tr>
<td width="40%">KEY</td><td width="60%">ACTUAL VALUE
<br><?php echo 'PHP ' . PHP_VERSION; ?></td></tr>
<?php
$lc01tm01 = localtime();
foreach($lc01tm01 as $lc01 => $l01)
{
echo '<tr><td>' . $lc01 . '</td><td>', $l01 . '</td></tr>';
}
?>
<tr><td colspan="2">ed48</td></tr></tbody></table>
<table width="100%" cellspacing="5" cellpadding="5"
border="1" align="center"><tbody>
<tr><td colspan="2">ASSOCIATIVE ARRAY</td></tr><tr>
<td width="40%">KEY</td><td width="60%">ACTUAL VALUE
<br><?php echo 'PHP ' . PHP_VERSION; ?></td></tr>
<?php
$tmstp02 = time();
$isass02 = TRUE;
$lctm02 = localtime($tmstp02, $isass02);
foreach($lctm02 as $lc02 => $l02)
{
echo '<tr><td>' . $lc02 . '</td><td>', $l02 . '</td></tr>';
}
?>
<tr><td colspan="2">ed48</td></tr></tbody></table>
<table width="100%" cellspacing="5" cellpadding="5"
border="1" align="center"><tbody>
<tr><td colspan="2">ASSOCIATIVE ARRAY</td></tr><tr>
<td width="40%">KEY</td><td width="60%">ACTUAL VALUE
<br><?php echo 'PHP ' . PHP_VERSION; ?></td></tr>
<?php
date_default_timezone_set('Europe/Lisbon');
$tzref = date_default_timezone_get();
$tmstp03 = time();
$isass03 = TRUE;
$lctm03 = localtime($tmstp03, $isass03);
foreach($lctm03 as $lc03 => $l03)
{
echo '<tr><td>' . $lc03 . '</td><td>', $l03 . '</td></tr>';
}
?>
<tr><td colspan="2">ed48</td></tr></tbody></table>