javascript函数查找下周同一天的日期 [英] javascript function to find the date for the same day in next week
本文介绍了javascript函数查找下周同一天的日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想要一个JavaScript函数来查找下周同一天的日期??
也就是说,如果今天是星期五,那么下一个星期五的日期是什么???
I want a javascript function to find the date for the same day in next week??
ie if today is Friday what will be the date of next Friday??
推荐答案
您只需将日期添加7天,就像这样:
You would simply add seven days to your date like so:
var today = new Date();
today.setDate(today.getDate() + 7);
这篇关于javascript函数查找下周同一天的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文