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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:24:32+00:00 2026-06-08T17:24:32+00:00

How to add a day (or 2 days) to date 31.07.2012 and return result

  • 0

How to add a day (or 2 days) to date 31.07.2012 and return result in format dd.MM.yyyy (same format as input 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-06-08T17:24:33+00:00Added an answer on June 8, 2026 at 5:24 pm
        var numDaysToAdd = 2;
        var inputDateString = "31.07.2012";
        var resultDate = stringToDate(inputDateString);
        resultDate.setDate( resultDate.getDate()+numDaysToAdd );
        var result = dateToString( resultDate );
    
    
        alert(result);
    
        function stringToDate( aString )
        {
            var dateArray = aString.split(".");
            return new Date(dateArray[2],dateArray[1]-1,dateArray[0]);
        }
    
        function dateToString( aDate )
        {
            var date = aDate.getDate();
            date = (date > 9) ? date : "0"+date.toString();
    
            var month = aDate.getMonth()+1;
            month = (month > 9) ? month : "0"+month.toString();
    
            var year = aDate.getFullYear();
    
    
            return (date+"."+month+"."+year);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a php function to add number of days to input date function
I have function: sample(date){ //operations, for example add one week (7 days) return date;
How can I add the suffix on the day number of a unix date?
private String setDate(int day) { Calendar cal = Calendar.getInstance(); cal.setTime(new Date()); cal.add(Calendar.DATE, + day);
I need to add days to given string date and display calculated date in
I create a form like this with Symfony2: $builder ->add('days', 'date', array( 'widget' =>
Good Day . I just wanna ask about adding days in a given date.
Possible Duplicate: How to add number of days to today's date? I'm confused, I
I want to insert row for each day to add new values, and I
Good Day! i want to add a subview in another view in iphone. and

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.