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

  • Home
  • SEARCH
  • 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

Ask A Question

Stats

  • Questions 349k
  • Answers 349k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer "By doing this, all those methods and variables are seen… May 14, 2026 at 6:45 am
  • Editorial Team
    Editorial Team added an answer If this happens on your second call to require, it's… May 14, 2026 at 6:45 am
  • Editorial Team
    Editorial Team added an answer You would use a library like iText or iTextSharp to… May 14, 2026 at 6:45 am

Related Questions

I'm trying to change a JList inside a JScrollPane dynamically, using myList.setListData(someArray); After this
I have a form containing a list of input fields that the user populates
I am getting crazy with the localization of an MVC application. After a recent
I need to revoke an authentication cookie if the user no longer exists (or
I'm trying to use MVC for a new project after having been around the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.