How to know date and time of my cPanel based server via PHP? UPDATED [DEC – 2021]

Hello Friends!!!

How to know the Date and Time of my server from cPanel? [UPDATED –  DEC – 2021]

 

You can easily check the exact date and time of your server with some PHP codes. So here in this blog, I am going to tell you a PHP code that will help you to know the date and time of your server from Cpanel

Easy steps to check the Date & Time of my cPanel based server [Updated DEC – 2021]

step::1 Login to your cPanel

step::2 Open File Manager section

How to know Date and Time of my server from cPanel
How to know the Date and Time of my server from cPanel

step::3 Go inside Public_html and Create a .php file

step::4 Now after right click on the file to edit

step::5 Now just place the below PHP code


<?php
date_default_timezone_set(‘Asia/Kolkata’);

$timestamp = time();
$date_time = date(“d-m-Y (D) H:i:s”, $timestamp);
echo “Current Date & Time Of The Server Is: $date_time”;
?>


If you are from India just replace America/New_York with Asia/Kolkata

step::6 Click on Save


Now run this file from the new tab and get the result

Hope this helps you!!!

Thanks for Reading!!!!

Scroll to Top