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 |
How do I install php?
Tell me which programming language does php resemble to?
What do the initials of php stand for?
Is php better than python?
How many escape sequences are recognized in double-quoted strings in php?
What are the current versions of apache, PHP, and mysql?
Under what circumstance is it impossible to assign a default value to a parameter while declaring a function?
What is difference between session and cookies in php?
What is the difference between require_once and require in php?
What is local variable in php?
How to take a substring from a given string?
What are super global variables in php?