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 |
What is the functionality of the function strstr and stristr?
which function used to get the file name in php?
Explain about require and include function?
Can we override magic methods in php?
What is php explain?
What is the main difference between asp net and php?
i want the different aptitude questions on interview way
is 'easyphp' is compelete technology to design a phpmysql site?
how to include external php file in to html page?
How do you add a joomla Template in admin panel of joomla? Please mention the steps
3 Answers Cognizant, T3 Softwares,
What are Routines?
How to access a global variable inside a function?