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 8305107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:00:25+00:00 2026-06-08T18:00:25+00:00

I am working on an iPhone app where I am getting date and time(separate)

  • 0

I am working on an iPhone app where I am getting date and time(separate) from user and submitting it to my php web service. php web service is then supposed to take this date and time and save it to utc timezone. I have read that I will also require local timezone in php file to convert it to utc. I am getting ‘Asia/Kolkata (IST) offset 1980’ as my timezone value in my iPhone application and can send it to php file. Now how will I convert date, time and timezone to utc date.

I have to convert the date to utc format so that I can query my table to get me data which is not past local time.

Thanks in advance

Regards
Pankaj

  • 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-06-08T18:00:26+00:00Added an answer on June 8, 2026 at 6:00 pm

    Use setTimeZone to convert the timezone from whatever the user sends to UTC:

        $utz = new DateTimeZone($input['timezone']);
        $udt = new DateTime($input['date'].' '.$input['time'], $utz);
        $udt->setTimezone(new DateTimeZone('UTC'));
    
        echo $input['date'].' '.$input['time'].' '.$input['timezone'].' is '.$udt->format('Y-m-d H:i:s')." UTC\n";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Am working in an iPhone app with using the NSDateFormatter. Am getting the time
I'm working on an iPhone app that offers the user the opportunity to send
I am working on an iPhone App where I am pulling data from an
Has anyone had difficulty getting what has otherwise been a solid iPhone app working
I am working on an iPhone app which involves using json-framework.I am getting array
I am working on an iPhone app and am getting (null) references to IBOutlet
I am having trouble removing leaks from an iPhone app that i'm working on.
I am working an iPhone app which is using CLLocationManager. When a user goes
I'm working on a text editor iPhone app where a user can type and
I integrated Google's AdMob SDK into a working iPhone app. I'm getting 12 errors

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.