Get Current Indian Time In PHP

0
94

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.

Previous articleBasic Java Operators
Next articleBest PHP Projects With Source Code Free Download
Hello Itsourcecoders, welcome to itsourcecode.com. I'm Joken Villanueva, MIT a passionate Blogger, Programmer and a Hobbyist. I started Itsourcecode because I wanted to give back and Share all the learnings and knowledge I've learned in my career and I believe through this website I would be able to help and assist those newbie programmers in enhancing their skills from different programming languages. So let us all help each other by sharing our ideas!

Leave a Reply

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