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 |
Explain how to execute a php script using command line.
Inside a php function, what param needs to be set in order to access a global variable?
Tell me in php, objects are they passed by value or by reference?
How to convert strings in hex format?
How do I install php and apache on windows 10?
Describe the importance of DABA BASE ABSTRACTION LAYERS in PHP and database connection?
What is get method in java?
What is the use of magic function in php?
I went to an php interview yesterday.I got selected there.But,They asked me to sign bond by submitting my certificates for 2 years.Is it good or bad
What is the difference between echo print and print_r in php?
Which is the best method to fetch the data from mysql? 1.mysql_fetch_array() 2.mysql_fetch_object() 3.mysql_fetch_row() 4.mysql_fetch_assoc()
What is return value in php?