How can we convert the time zones using PHP?
Answer / vijaya
By using date_default_timezone_get and
date_default_timezone_set function on PHP 5.1.0
// Discover what 8am in Tokyo relates to on the East Coast
of the US
// Set the default timezone to Tokyo time:
date_default_timezone_set('Asia/Tokyo');
// Now generate the timestamp for that particular timezone,
on Jan 1st, 2000
$stamp = mktime(8, 0, 0, 1, 1, 2000);
// Now set the timezone back to US/Eastern
date_default_timezone_set('US/Eastern');
// Output the date in a standard format (RFC1123), this will
print:
// Fri, 31 Dec 1999 18:00:00 EST
echo '
', date(DATE_RFC1123, $stamp) ,'
';?>
| Is This Answer Correct ? | 13 Yes | 6 No |
Is there any function to find repeated value in an array? What is w2 standard
What is the apache?
what is benefit of magento?
To find out the current year is leap year or not which date() function we've to use.Give the syntax also
What is 'float' property in css?
What is return value in php?
Tell me what is the difference between exception::getmessage and exception::getline?
How can you get the size of an image in PHP?
Would you initialize your strings with single quotes or double quotes?
How can we encrypt the username and password using PHP?
13 Answers Avaria, HCL, TCS, Xpert,
What is meant by PEAR in PHP?
How to create and destroy cookies in php?