Jo Smo Jo Smo - 1 year ago 116
PHP Question

How to convert a datetime string to UTC?

How can i convert a datetime string like this:

2012-09-03 22:00
US Estern to UTC timezone?

Answer Source

You should look at the DateTime object and its related functions in the documentation.

If your input date is already in a string format, DateTime::createFromFormat() will help you create an epoch-type integer date the object can work with. After that, it's just getTimezone() and setTimezone().

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download