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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:11:59+00:00 2026-05-16T20:11:59+00:00

I need to increment a date value by one day in JavaScript. For example,

  • 0

I need to increment a date value by one day in JavaScript.

For example, I have a date value 2010-09-11 and I need to store the date of the next day in a JavaScript variable.

How can I increment a date by a 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-05-16T20:12:00+00:00Added an answer on May 16, 2026 at 8:12 pm

    Three options for you:

    1. Using just JavaScript’s Date object (no libraries):

    My previous answer for #1 was wrong (it added 24 hours, failing to account for transitions to and from daylight saving time; Clever Human pointed out that it would fail with November 7, 2010 in the Eastern timezone). Instead, Jigar’s answer is the correct way to do this without a library:

    // To do it in local time
    var tomorrow = new Date();
    tomorrow.setDate(tomorrow.getDate() + 1);
    
    // To do it in UTC
    var tomorrow = new Date();
    tomorrow.setUTCDate(tomorrow.getUTCDate() + 1);
    

    This works even for the last day of a month (or year), because the JavaScript date object is smart about rollover:

    // (local time)
    var lastDayOf2015 = new Date(2015, 11, 31);
    console.log("Last day of 2015: " + lastDayOf2015.toISOString());
    var nextDay = new Date(+lastDayOf2015);
    var dateValue = nextDay.getDate() + 1;
    console.log("Setting the 'date' part to " + dateValue);
    nextDay.setDate(dateValue);
    console.log("Resulting date: " + nextDay.toISOString());

    2. Using MomentJS:

    var today = moment();
    var tomorrow = moment(today).add(1, 'days');
    

    (Beware that add modifies the instance you call it on, rather than returning a new instance, so today.add(1, 'days') would modify today. That’s why we start with a cloning op on var tomorrow = ....)

    3. Using DateJS, but it hasn’t been updated in a long time:

    var today = new Date(); // Or Date.today()
    var tomorrow = today.add(1).day();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to increment a float value atomically. I get its int value by
I have an application where I need to INSERT an auto_increment value from a
I have table with an auto-increment field, but I need to transfer the table
I need to convert a String like 2010-11-28 into Date type to be saved
I need to increment the month of a datetime value next_month = datetime.datetime(mydate.year, mydate.month+1,
I need to increment minutes and seconds (in relation to time) in a variable.
I need to get the number after the button to increment in a for
Basically I need to reset Identity Increment for all tables to its original. Here
I have a need to sync auto_increment fields between two tables in different databases
Is there a integer element for a cookie? I need the cookie to increment

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.