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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:31:03+00:00 2026-05-15T21:31:03+00:00

I am working on task in which dates are involved. I have a person’s

  • 0

I am working on task in which dates are involved. I have a person’s age in months+days. Now I want to get a date when this person reach to a specific age in months.

For example:

A person is 250 months and 15 days old on 2010-1-25.
On which date this person will become 300 months old? 

Function Signature may be:

function getReqDate( $startDate, $currAgeMonths, $currAgeDays, $reqAgeMonths  ) {
      //return 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-15T21:31:04+00:00Added an answer on May 15, 2026 at 9:31 pm

    Since you calculate the current age from the birthdate, I suggest you also use the birthdate instead of the current age to calculate when a user gets 300 months old. The following is the equivalent of the DateTime solution given above (does not require 5.3):

    echo date('r', strtotime('+300 months', strtotime('1990-10-13')));
    

    With the second param being the birthdate timestamp the above would give

    Tue, 13 Oct 2015 00:00:00 +0200
    

    Further reading:

    • https://www.php.net/manual/en/function.strtotime.php
    • http://www.rafaeldohms.com.br/2006/09/15/strtotime-is-it-useful/en/
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a appliaction in which I have a following schema Tasks
I'm working with a task specific .NET plattform, which is precompiled and not OpenSource.
I have a task which i need to cancel if the wait time is
I'm working this programming task for college where we have to write a c++
i am working on a task scheduler applications as my college project, i have
I'm working on a task which I never worked in earlier. Task: Monitor a
I am working on a task which includes data such as length of a
I have a rake task that won't work unless a table exists. I'm working
A common task in programs I've been working on lately is modifying a text
Working with dates in ruby and rails on windows, I'm having problems with pre-epoch

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.