ADVERTISEMENT
ADVERTISEMENT

PHP program to print the timestamp of the start of the request

Here, we are going to learn how to print the timestamp of the start of the request in PHP?
Submitted by Nidhi, on November 24, 2020

Here, we will use $_SERVER[' REQUEST_TIME '] superglobal, which is used to return the timestamp of the start of the request.

Program/Source Code:

The source code to print the timestamp of the start of the request is given below. The given program is compiled and executed successfully.

<?php
//PHP program to print the timestamp 
//of the start of the request.

$requestTime = $_SERVER['REQUEST_TIME'];

printf("Timestamp: %s<br>", $requestTime);
?>

Output:

Timestamp: 1604073329

Explanation:

In the above program, we used $_SERVER[REQUEST_TIME'] superglobal that returns the timestamp of the start of the request, which is assigned to the variable $request. After that, we printed the timestamp using printf() on the webpage.

More PHP Programs »


ADVERTISEMENT



ADVERTISEMENT



Comments and Discussions


ADVERTISEMENT

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.