Get Current Indian Time In PHP

0
38

Get Current Indian Time In PHP

This tutorial is about how to get current Indian time in PHP. There so many options on how to do display the Current Time and date in India.

In order to get the user current timezone, you need to have a javascript. Else, you have to make a default timezone on your pages. For example, you can use “date_default_timezone_set”.

Code to Get Current Indian time in PHP

To begin with, you open a text editor you like. In my case I use SublimeText. Then, create a PHP file. Finally, add the following code and save.

 

How to test the PHP code?

To test the PHP code, you have to open a browser. Then, type the “Localhost/currenttime.php” and press enter. After this step, you will be able to see the result just like as shown in the image below.

get current indian time php
get current Indian time PHP

Anyway, if you want to study further about the date in PHP. You visit this tutorial about Unix Timestamp using PHP.

If you have any questions about this topic, please let us know maybe we can help.

Facebook Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.