Solved

convert php timestamp to timezone

Posted on 2013-11-21
3
385 Views
Last Modified: 2013-11-22
I'm writing a wordpress plugin to send out appointment reminders and it seems the appointments are stored in UTC on the  server.

I can get the appointment timestamp just fine, but I can't seem to convert it from UTC to 'Atlantic/Bermuda' time zone.

PHP 5.2, can some one help me convert a timestamp to that of a different timezone?
0
Comment
Question by:tf2012
3 Comments
 
LVL 16

Accepted Solution

by:
HagayMandel earned 500 total points
ID: 39667317
This article will assist you.
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39667678
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_201-Handling-date-and-time-in-PHP-and-MySQL.html

If you know the UNIX timestamp, you're in luck because it's the same all over the world at any given moment.  You can convert it into a "local" time with PHP built-in capabilities.  There are procedural ways described in the article, and there is an object-oriented thing, too.  See the examples here:
http://php.net/manual/en/datetime.settimezone.php
0
 
LVL 1

Author Closing Comment

by:tf2012
ID: 39668350
great thanks!
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo‚Ķ
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question