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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:15:17+00:00 2026-06-04T01:15:17+00:00

I have date in this format (YYYYMM): 201201 // Gen, 2012 201202 // Feb,

  • 0

I have date in this format (YYYYMM):

201201  // Gen, 2012
201202  // Feb, 2012
201203  // ecc

Let’s say from 201203 I want to subtract 4 months. I can’t do 201203 - 4 because it’s = 201199

201203 - 4 should output 201111 (Nov, 2011)

Maybe i should convert my string to a date and then pass it to strtotime with -4 month?

Any suggest ?

  • 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-04T01:15:19+00:00Added an answer on June 4, 2026 at 1:15 am

    You can use strtotime in PHP:

    $date = strtotime('2012-05-01 -4 months');
    

    This article will help you.

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

Sidebar

Related Questions

I have a date in NSString format with this content: 29/02/2012 12:00:00 AM I'm
I have the need to display a date in this format: dd/mm/yyyy. This is
I have date 2012-04-02 10:01:00 am I want to show this date in with
I have this date and time format: 2010-05-19 07:53:30 and would like to change
I have a slight problem, I have a date format coming from php my
I am getting date in 2011-10-01T21:00:00.0000000-07:00 format from the server. I have tried to
I have the following date: 2011-08-12T20:17:46.384Z . What format is this? I'm trying to
I'm parsing this date format from XML:=> 2011-12-06T07:41:14.016+00:00 , and I'm getting this error:
I have a date returned in this format YYYY-MM-DD, e.g. 2011-04-29. Using jQuery how
In my project i am getting 2008-02-01T10:03:23.793-06:00 this date format in string i have

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.