<?php
arr|float gettimeofday ([ bool $as_float = FALSE ] )
where,
$as_float = To control if the returned value will be
a float number or an ARRAY
?>
ARRAY KEYS | MEANING | |
sec | seconds since the Unix Epoch | |
usec | microseconds | |
minuteswest | minutes west of Greenwich | |
dsttime | type of DST correction | |
ed48 |
<?php
$gttday01 = gettimeofday();
// an array is returned
echo 'seconds since the Unix Epoch = ' . $gttday01['sec'];
echo '<br><br>microseconds = ' . $gttday01['usec'];
echo '<br><br>minutes west of Greenwich = ' . $gttday01['minuteswest'];
echo '<br><br>type of DST correction = ' . $gttday01['dsttime'];
?>
<?php
$gttday02 = gettimeofday(true);
// a float value is returned
echo 'The current time = ' . $gttday02;
?>
<?php
setlocale(LC_ALL, "en_US", "american",
"american english",
"american-english",
"english-american",
"english-us",
"english-usa",
"enu", "us", "usa");
$ddf03a = date_default_timezone_set('America/Los_Angeles');
$gttday03 = gettimeofday(TRUE);
echo $ddf03a . ':<br>' . $gttday03 . '<br><br>';
$ddf03b = date_default_timezone_set('UTC');
echo $ddf03b . ':<br>' . $gttday03 . '<br><br>';
?>