php time() function


  Translation results:

英[taɪm] 美[taɪm]

n.Time; time; era; time

vt. Arrange time for...; measure the time of...; adjust (mechanical) Speed; the speed with which a clock or watch is set correctly

vi. In time; Harmony; Beat

adj. Timing; Regular; [American English] Installment (payment)

int.[Sports]

Third person singular: times Plural: times Present participle: timing Past tense: timed

php time() functionsyntax

How to use the time() function?

php time() function is used to return the unix timestamp of the current time. The syntax is time(), which returns the number of seconds since the Unix epoch (January 1, 1970 00:00:00 GMT) to the current time.

Function: Return the unix timestamp of the current time

Syntax: time()

Parameters:# The ##time() function only returns the unix timestamp of the current time without parameters.

Description: Returns the number of seconds since the Unix epoch (January 1, 1970 00:00:00 GMT) to the current time.

php time() functionexample

<?php
$i = time();
echo $i;
?>

Run instance»

Click the "Run instance" button to view the online instance

Output:

1523947811
<?php
$time=time();
echo "当前时间戳为:".$time."<br>";
echo "转换为具体时间为:".(date("Y-m-d",$time));
?>

Run instance»

Click the "Run instance" button to view the online instance

Output:

当前时间戳为:1524705185
转换为具体时间为:2018-04-26

Popular Recommendations

Home

Videos

Q&A