本文介绍了datetimepicker差异值在文本框中出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在这里,我试图区分两个datetimepicker值并在文本框中显示输出。代码如下所述。
Here, I am trying to take difference of two datetimepicker values and show output in a textbox. code is mentioned below.
DateTime start = dateTimePicker2.Value;
DateTime finish = dateTimePicker3.Value;
TimeSpan NoDays = finish - start;
int TotalDays = NoDays.Days;
textBox4.Text = ((int)Math.Ceiling(NoDays.TotalDays)).ToString();
虽然两个日期之间只有一天的差异,但是执行输出的数字就像文本框中的43205一样。
请建议。
While executing output is coming in numbers like 43205 in textbox even if there is a single day difference between both the dates.
Please suggest.
推荐答案
这篇关于datetimepicker差异值在文本框中出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!