我在C#中的DateTime.AddHours方法有问题。我已经注意到,我添加到特定日期/时间的时间更多。我失去的更多的天数/小时数。例如:
DateTime DateOne = DateTime.Now;;
DateTime DateTwo = DateOne.AddHours(438000); // 50 years
Run Code Online (Sandbox Code Playgroud)
我为DateOne课程增加了50年的学习时间,因此我应该得到3/10/2069。
但是,如果打印,DateOne您将得到:3/10/2019,这是当前日期,但是如果打印,DateTwo您将得到:2/25/2069。在50年的变化中损失了10天以上。
一定有问题。我到底在做什么错?
| 归档时间: |
|
| 查看次数: |
37 次 |
| 最近记录: |