Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add days to date format yyyy-mm-dd

The question is simple, how can I add days to a date in YYYY-MM-DD format?

For example, increment a date given in this format: "2013-02-11" to "2013-02-12"?

like image 200
Simulator88 Avatar asked Feb 12 '13 21:02

Simulator88


People also ask

What is YYYY MM DD format?

YYYY/MM/DD. Four-digit year, separator, two-digit month, separator, two-digit day (example: 1999/12/15) DD/MM/YYYY. Two-digit day, separator, two-digit month, separator, four-digit year (example: 15/12/1999)

How do I change the date format from YYYY MM DD in Excel?

First, pick the cells that contain dates, then right-click and select Format Cells. Select Custom in the Number Tab, then type 'dd-mmm-yyyy' in the Type text box, then click okay. It will format the dates you specify.

What is YYYY format for date of birth?

The correct format of your date of birth should be in dd/mm/yyyy. For example, if your date of birth is 9th October 1984, then it will be mentioned as 09/10/1984.

How do I change the date format from YYYY MM DD in jquery?

var tempDate = new Date("2021-09-21"); var formattedDate = [tempDate. getMonth() + 1, tempDate. getDate(), tempDate. getFullYear()].


1 Answers

date      = new Date('2013-02-11');
next_date = new Date(date.setDate(date.getDate() + 1));

here's a demo http://jsfiddle.net/MEptb/

like image 89
Sanjay Kamaruddin Avatar answered Sep 24 '22 06:09

Sanjay Kamaruddin