HomeMenu
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] => 1733460417
    [usec] => 622496
    [minuteswest] => 0
    [dsttime] => 0
)

2 · as_float

<?

$as_float = true;

$return = gettimeofday($as_float);

echo $return;
1733460417.686