- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
function getDateOfNextDay(datestring, separator, nozero) {
if(!separator) {
separator="-";//="yyyy-dd-mm" format
}
var a_date = datestring.split(separator);
var myday = new Date(a_date[0]+'/'+a_date[1]+'/'+a_date[2]);
myday.setDate(myday.getDate()+1);
var next_day_year = myday.getFullYear();
var next_day_month = myday.getMonth()+1;
if(!nozero) {
next_day_month = (parseInt(next_day_month)<10)?"0"+next_day_month:next_day_month;
}
var next_day_day = myday.getDate();
next_day_day = (parseInt(next_day_day)<10)?"0"+next_day_day:next_day_day;
return next_day_month+"-"+next_day_day+"-"+next_day_year;
}
Первое что нашел гугл по запросу "javascript next day offset", автор "Arvind Kumar Thakur. I am a web developer with 7 years of hands on experience", ссылка http://www.devarticles.in/javascript/getting-next-day-date-in-javascript
А всего-то навсего необходимо было сделать:
>>> dt = new Date('2012-12-31')
>>> dt.setTime(dt.getTime()+86400000) /* 1000 * 60 * 60 * 24, ms*sec*min*hour = day offset */
Индейцы =\