日期时间检查,看看是否明天 [英] DateTime check to see if its tomorrow
本文介绍了日期时间检查,看看是否明天的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
在我的应用程序中,我正在实现日期时间,其中我利用了Silverlight工具箱中的datepicker和timepicker.在应用中,我可以添加天数或添加时间以设置日期 时间.
In my application I am implementing date time wherein I am making use of datepicker and timepicker from silverlight toolkit. In the app I can add days or add time in order to set date time.
我被困在某一点,当我添加时间,如果当前时间是11.50,如果我添加15分钟,则状态应更改为明天的日期.
I am stuck at one point wherein when i add time and if the current time is 11.50 and if I add 15 mins the status should change to tomorrows date.
如何根据明天的日期加上15分钟的时间进行此项检查.
How can I make this check based on time that on addition of 15 mins its tomorrows date.
请帮助.
预先感谢
推荐答案
这是一种简单的方法:
DateTime currentTimestamp = DateTime.Now;
int currentDayOfMonth = currentTimestamp.Day;
currentTimestamp = currentTimestamp.AddMinutes(15);
if (currentTimestamp.Day == currentDayOfMonth + 1)
Debug.WriteLine("it's tomorrow!");
安德鲁
这篇关于日期时间检查,看看是否明天的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文