如何根据一天中的一天来计算日期 [英] how to calculate date on the basis of no of day
本文介绍了如何根据一天中的一天来计算日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果输入日数,如何计算两个日期.
如果输入10天,则为这样的年龄.
然后它会计算10天后的日期,今天是今天.
how to calculate two date if you input no of day.
such age if i input 10 day.
then it calculate date after 10 day, form today.
推荐答案
尝试一下:
Try this :
int days = 10;
DateTime myDate = DateTime.Now;
DateTime toDate = myDate.AddDays(days);
希望这会有所帮助.
Hope this helps.
这篇关于如何根据一天中的一天来计算日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文