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 alias in php?

0 Answers  


What is the difference between characters 34 and x34?

0 Answers  


What is variable and data type?

0 Answers  


can any one find and tell the difference between dot net and php which one is best ? which one we get more salary? which one is stable and which one is best for freshers and also better in future and carrer ? which one we wil get more salary sir ? please send ur valuable suggestions to kiranpulsar2007@gmail.com

3 Answers  


What is the use of addslashes in php?

0 Answers  






hai plz inform me specific books fo0r paper1,paper2 and paper 3 of group2 examination... plz giv me at the earliest......

1 Answers   APPSC, HCL,


What is the difference between htmlentities and htmlspecialchars in php?

0 Answers  


Which is better php or wordpress?

0 Answers  


Why session is required?

0 Answers  


How to upload file in php?

0 Answers  


What are the rules to declare a php variables?

0 Answers  


How to remove leading and trailing spaces from user input values?

0 Answers  


Categories