Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

how can i get USA time using php...

Answer Posted / arunkumar.s

Hello friends,
Following time zones are used EST,CST,MST,PST,AKST,HST. If
you want to get EST time then,

<?php
putenv('TZ=EST');
echo date("H:i:s :a");
?>


All other time zone's
<?php
putenv('TZ=EST');
echo date("H:i:s :a");
echo "<br/><br/>";
putenv('TZ=CST');
echo date("H:i:s :a");
echo "<br/><br/>";
putenv('TZ=MST');
echo date("H:i:s :a");
echo "<br/><br/>";
putenv('TZ=PST');
echo date("H:i:s :a");
echo "<br/><br/>";
putenv('TZ=AKST');
echo date("H:i:s :a");
echo "<br/><br/>";
putenv('TZ=HST');
echo date("H:i:s :a");
?>

Pls check and try
All the best

Is This Answer Correct ?    7 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is CURL?

208


Write a program to display table of a number using php?

155


What is the use of curl()?

180


What is php data type?

153


How to uploaded files to a table?

197






What is framework in php for beginners?

152


What is the importance of php?

144


How can we determine whether a variable is set?

178


Which is useful for method overloading?

199


How to replace a substring in a given string in php?

184


How to create a public static method in PHP?

182


Php program to generate fibonacci series?

175


What is the w3c?

2464


What does the scope of variables means?

214


Explain php parameterized functions.

167