Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6042283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:46:22+00:00 2026-05-23T06:46:22+00:00

I am pulling a feed from Google Calendar. It has the event start time

  • 0

I am pulling a feed from Google Calendar. It has the event start time in this format:

StartDate: 2011-06-25T18:00:00.000-05:00

I understand that the -05:00 is the timezone offset. I need the above to get put into the mySQL database in GMT time. I was just reading about date() and gmdate() but I’m afraid I’m pretty new at this and I don’t seem to be getting the results I need.

Right now the above code ends up being this in my datetime colum in mySQL:

2011-06-25 18:00:00

I need the above to be:

2011-06-25 23:00:00

But I need a dynamic way to do this so any user with a different timezone will get the correct results-IE: I need the function to be smart enough to read the timezone offset and make the needed changes regardless of the offset. I’m hoping there is a PHP function that does this already?

Thanks for any help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T06:46:23+00:00Added an answer on May 23, 2026 at 6:46 am

    If you use strtotime, you can do this:

    <?
    date_default_timezone_set('UTC');
    $date = strtotime('2011-06-25T18:00:00.000-05:00');
    echo date('Y-m-d H:i:s',$date);
    

    This results on my system in:

    2011-06-25 23:00:00
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having an issue when pulling/listing an event feed from Google Calendar in python,
I'm pulling data from a calendar feed and each event in the calendar has
I have created a jquery fullcalendar, pulling the feed from a google calendar and
I'm pulling dates from an xml feed that has this form 12/10/2010 19:30:00 and
I'm pulling an RSS feed from a remote location using ServerXmlHttp: Dim httpRequest set
I am pulling a timestamp from a feed and it gives 12 digits (1269088723811).
In my application I'm pulling back a user's feed. This contains all of that
I'm pulling an Atom feed from Confluence . Some of the links and images
I'm pulling data from a feed that I have no control over and I
I'm pulling data from an XML feed and manipulating it using the awesome SimpleXMLElement.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.