Use DateTime
and DateTimeZone
.
$date = new DateTime('2012-07-16 01:00:00 +00');
$date->setTimezone(new DateTimeZone('Europe/Moscow')); // +04
echo $date->format('Y-m-d H:i:s'); // 2012-07-15 05:00:00
More Related Contents:
- Timezone conversion in php
- How to find day of week in php in a specific timezone
- php convert datetime to UTC
- PHP, MySQL and Time Zones
- Convert UTC dates to local time in PHP
- Set timezone in PHP and MySQL
- php: setting a timezone by UTC offset
- How to update timezonedb in PHP (updating timezones info)?
- How to tell if a timezone observes daylight saving at any time of the year?
- Different timezone_types on DateTime object
- How to detect Ambiguous and Invalid DateTime in PHP?
- get user timezone [duplicate]
- How do I compare two DateTime objects in PHP 5.2.8?
- Add ‘x’ number of hours to date
- How to get client’s timezone? [duplicate]
- Simplest way to increment a date in PHP?
- Get interval seconds between two datetime in PHP?
- Convert UTC offset to timezone or date
- Check whether the string is a unix timestamp
- How to store NULL values in datetime fields in MySQL?
- NOW() function in PHP
- Automatically detect user’s current local time with JavaScript or PHP
- How to compare two time in PHP
- python format datetime with “st”, “nd”, “rd”, “th” (english ordinal suffix) like PHP’s “S”
- How do I find the hour difference between two dates in PHP?
- How do you explain the result for a new \DateTime(‘0000-00-00 00:00:00’)?
- Storing datetime as UTC in PHP/MySQL
- PHP Fatal error: Call to a member function format() on boolean
- Get a PHP DateTime difference in days, considering midnight as a day change
- Get date for monday and friday for the current week (PHP)