Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

gettimeofday

Description

The gettimeofday of Date / Time for PHP get current time.

Syntax

gettimeofday(
    bool $as_float = false
): array|float

Parameters

as_float

When set to true, a float instead of an array is returned.

Return

By default an array is returned. If as_float is set, then a float is returned.

KeyDescription
"sec"seconds since the Unix Epoch
"usec"microseconds
"minuteswest"minutes west of Greenwich
"dsttime"type of dst correction

Examples

1 · void

<?

$return = gettimeofday();

print_r($return);

?>
Array
(
    [sec] => 1726062818
    [usec] => 108288
    [minuteswest] => 0
    [dsttime] => 0
)

2 · as_float

<?

$as_float = true;

$return = gettimeofday($as_float);

echo $return;

?>
1726062818.1799
HomeMenu