vb.net 将当前日期加一个月
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1382823/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
To add one month to current date
提问by user42348
I have to add one month to todays date and have to get date after 1 month.Can anybody help?
我必须在今天的日期上加一个月,并且必须在 1 个月后获取日期。有人可以帮忙吗?
回答by Philip Fourie
Dim newDate as DateTime = DateTime.Now.AddMonths(1)
回答by Marcin Deptu?a
dateAfterMonth = dateAfterMonth.AddMonths(1)
If you would add 1 month from now:dateAfterMonth = DateTime.Now.AddMonths(1)
dateAfterMonth = dateAfterMonth.AddMonths(1)
如果您从现在开始添加 1 个月:dateAfterMonth = DateTime.Now.AddMonths(1)
回答by pero
回答by Simon
using Fluent DateTime http://fluentdatetime.codeplex.com/
使用 Fluent DateTime http://fluentdatetime.codeplex.com/
Dim newDate as DateTime = 1.Months().FromNow()