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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:50:52+00:00 2026-05-23T18:50:52+00:00

I have a date in this format {Y,M,D} . Is there any good supporting

  • 0

I have a date in this format {Y,M,D}. Is there any good supporting libraries or, tricks I can use to simply, say subtract three months from this date without running into problem with invalid dates, leap years, etc.

My latest similar use is in MySql where you can type:

Select '2011-05-31' - Interval 3 Month;

which yields '2011-02-28'. I am not interested in how to write this library myself, that is what I would like to avoid.

  • 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-23T18:50:52+00:00Added an answer on May 23, 2026 at 6:50 pm

    Use edate – specifically the shift function.

    > edate:shift({2011,5,31}, -3, months).
    {2011,2,28}
    

    Under the hood it uses the calendar module, so it correctly deals with all of the corner cases.

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

Sidebar

Related Questions

I have the need to display a date in this format: dd/mm/yyyy. This is
I have date of this format March 3, 2011 in database and I need
I have a date stored in a database in this format: 2011-02-23 13:00:00 I
I have this date as string with me 15-07-2011 which is in the format
i have this date's & Time's: date1: 10/04/2010 - Time: 08:09 date2: 11/04/2010 -
I have a date like this:- 20091023 i have to convert it to a
I have this: var date = new DateTime(2009, 12, 5); ... ... and need
I have a SQL Server 2005 output like this: Date | Result | Sum
I have a text like: I've got a date with this fellow tomorrow. Well
I have a untyped DataTable that looks like this (srcTbl): date col_1 col_2 ...

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.