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

time

Description

The time of Date / Time for PHP return current Unix timestamp.

Syntax

time(): int

Return

Returns the current time measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT).

Examples

1 · void

<?

$return = time();

echo $return;
1777573075

2

<?

$return = time();

$second = 1;
$minute = $second * 60;
$hour = $minute * 60;
$day = $hour * 24;
$week = $day * 7;
$month = $day * 30;
$year = $day * 365;

$format = "Y-m-d H:i:s";

echo date($format, $return) . " now". PHP_EOL
. date($format, $return + $second) . " next second" . PHP_EOL
. date($format, $return + $minute) . " next minute" . PHP_EOL
. date($format, $return + $hour) . " next hour" . PHP_EOL
. date($format, $return + $day) . " next day" . PHP_EOL
. date($format, $return + $week) . " next week" . PHP_EOL
. date($format, $return + $month) . " next month" . PHP_EOL
. date($format, $return + $year) . " next year";
2026-04-30 18:17:55 now
2026-04-30 18:17:56 next second
2026-04-30 18:18:55 next minute
2026-04-30 19:17:55 next hour
2026-05-01 18:17:55 next day
2026-05-07 18:17:55 next week
2026-05-30 18:17:55 next month
2027-04-30 18:17:55 next year