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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:19:37+00:00 2026-05-13T20:19:37+00:00

After I have validated the receipt against the App Store from my PHP server,

  • 0

After I have validated the receipt against the App Store from my PHP server, the App Store sends me back a JSON response with

"status" : 0 
"receipt" : ( .... )

One of the receipt items is “purchase_date” which contains the following string (example) “2010-02-09 19:17:04 Etc/GMT”

I’m trying to establish a subscription service and would like to add 3 months to this date and then write that expiry date into a MySQL table.

Is there a string-to-date type function in PHP that can allow me to achieve the adding of 3 months?

I have found this example which looks like it adds 1 month to a date:

$date = date("Y-m-d");// current date
$date = strtotime(date("Y-m-d", strtotime($date)) . " +1 month");

But I’m not sure how I can turn the string passed by the App Store into a PHP recognised date.

  • 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-13T20:19:37+00:00Added an answer on May 13, 2026 at 8:19 pm

    You have already done it, you just added one step too many.

    $purchase_date = "2010-02-09 19:17:04";
    $purchase_date_timestamp = strtotime($purchase_date);
    $purchase_date_3months = strtotime("+3 months", $purchase_date_timestamp);
    
    echo "Purchase date + 3months = ".date("Y-m-d h:i:s", $purchase_date_3months);
    

    this depends on strtotime recoginzing your time string – try it out first. But usually, strtotime can recognize any properly formatted anglo-american date/time string. If in doubt, check the manual.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class that after it does some stuff, sends a JMS message.
I have (after quite a bit of work) a web test that will upload
After much googling I have been wondering what the benefits/differences are between mysql and
After googling a bit I have found some tips about how to get online
After lots of attempts and search I have never found a satisfactory way to
I have a ContextMenu that is displayed after a user right clicks on a
After user places an order I have to send detailed email message containing order
I have a Rails application that unfortunately after a request to a controller, has
I have a query that is dynamically built after looking up a field list
After being troubled by an issue that I simply did not have the knowledge

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.