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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:52:00+00:00 2026-06-10T19:52:00+00:00

I have a random starting date (e.g. 2012-09-19). I would like to be easily

  • 0

I have a random starting date (e.g. 2012-09-19). I would like to be easily get the ending monthly cycles’ dates after this date. However, the monthly cycles are not exactly 30 days, but they are from date to date, e.g. 19 September to 19 October.

I would like to easily calculate the starting and ending date for, let’s say, the 5th or the 500the month after the subscription started, taking leap years into account. For example, if a subscription started on February 29 on a leap year and a non-leap year’s February comes, the ending date for the period should be February 28, without displacing future monthly cycles by one day.

  • 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-10T19:52:01+00:00Added an answer on June 10, 2026 at 7:52 pm

    This is quite easy it seems, using strtotime();

    Let’s say the initial date is 2012-02-29.

    function addToDate($date, $add){
            if(!strtotime($date)) return FALSE;
            $date = strtotime($date);
            return strtotime($add, $date);
    }
    
    $result = addToDate('2012-02-29', '+50 months');
    echo date('Y-m-d', $result);
    

    Will result in 2016-04-29.

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

Sidebar

Related Questions

Hi I have this basic random quote script, but I would like it to
I would like to have a random number generated based of a variable called
I have some random string, let's say : s = This string has some
I have text file which has text with newline char like this. I read
I have a list of directories starting from /root. Eg random text /root/dir1/files random
I'm starting developing a Web Site for a Sport Club. This site will have
I got requirements- 1. Have random values in a List/Array and I need to
Let's say you have a random number generator spitting out numbers between 1 and
Possible Duplicate: True random number generator I have worked with random functions in python,ruby,
I have a problem with random number generating in C# I have tried all

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.