0

I have a datetime string like this:

`2012-09-03 22:00 Central USA Time`. 

and i want to convert it to the UTC time zone.

1 Answer 1

1

Use gmdate() and strtotime() :

date_default_timezone_set('America/New_York');
echo gmdate('Y-m-d H:i', strtotime('2012-09-03 22:00'));

Instead of Central USA Time, use the supported timezones : http://www.php.net/manual/en/timezones.php

The date_default_timezone_get() function will always give you the right timezone

Sign up to request clarification or add additional context in comments.

3 Comments

But you didnt pass the original timezone ?!?!
Right, I'll edit my post, but you shouldn't use Central USA Time anymore
Same thing : date_default_timezone_set("America/New_York"); $localTime = date('Y-m-d H:i', $utctime);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.