How can i convert a datetime string like this: 2012-09-03 22:00 US Estern to UTC timezone?
How can i convert a datetime string like this: 2012-09-03 22:00 US Estern to
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should look at the
DateTimeobject 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 justgetTimezone()andsetTimezone().