how can i get USA time using php...



how can i get USA time using php.....

Answer / 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

More PHP Interview Questions

What is the functionality of the function strstr and stristr?

2 Answers  


which function used to get the file name in php?

5 Answers  


Explain about require and include function?

0 Answers  


Can we override magic methods in php?

0 Answers  


What is php explain?

0 Answers  






What is the main difference between asp net and php?

0 Answers  


i want the different aptitude questions on interview way

2 Answers  


is 'easyphp' is compelete technology to design a phpmysql site?

3 Answers  


how to include external php file in to html page?

8 Answers   Eccentric Infotech,


How do you add a joomla Template in admin panel of joomla? Please mention the steps

3 Answers   Cognizant, T3 Softwares,


What are Routines?

0 Answers  


How to access a global variable inside a function?

0 Answers  


Categories