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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T12:31:37+00:00 2026-05-12T12:31:37+00:00

I am trying to explain the details so that this is easy to understand.

  • 0

I am trying to explain the details so that this is easy to understand.

I want a list of month and year based on the difference of month and year.

I am implementing search functionality based on start month with year and end month with year.
So!

start Selection – 01(month)-2009 (Yr)

End selection 10(month)-2009 (Yr)

What I want from MySQL is:

Month                        Year
JAN                          2009
FEB                          2009
MAR                          2009
APR                          2009
MAY                          2009
JUN                          2009
JUL                          2009
AUG                          2009
SEP                          2009
OCT                          2009
  • 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-12T12:31:37+00:00Added an answer on May 12, 2026 at 12:31 pm

    FractalizeR answer is the right one.

    Just let me expand by defining the functions:

    function GetMonthsFromDate($myDate) {
      $year = (int) date('Y',$myDate);
      $months = (int) date('m', $myDate);
      $dateAsMonths = 12*$year + $months;
      return $dateAsMonths;
    }
    
    function GetDateFromMonths($months) {
      $years = (int) $months / 12;
      $month = (int) $months % 12;
      $myDate = strtotime("$years/$month/01"); //makes a date like 2009/12/01
      return $myDate;
    }
    

    PS: tried to post as a comment but the formating got screwed.
    (Of course this functions could be rewritten as one liners but wanted to be more readable)

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

Sidebar

Related Questions

I hope this I can explain what I am trying to achieve: I want
This is a function taken from Pro JavaScript techniques that I'm trying to understand,
I have another programmer who I'm trying to explain why it is that a
Can anyone explain this to me. I'm trying to inject a CSS file onto
Trying a lot and just failing.. $x = 76561198005785475; I want to this number,
I'm trying to write a recursive function that return a List < int *
I'm trying to create a website that allows for easy theme adding/manipulation like wordpress
I wrote out a long post trying to explain the exact details of the
Apologies for the horrible title. I spent 10 minutes trying to explain this in
I am trying to explain to myself the forecasting result from applying an ARIMA

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.