如何计算今天日期和最近2个月,3个月,4个月之间的差额...在C#Windows应用程序中

问题描述:

在今天的日期和最近的2个月,3个月,4个月之间...在C#Windows应用程序中

between today date and last 2 months,3 months,4months ...in c# windows application

您是否尝试过任何方法?您拥有有关C#的书籍吗?

如果您从另一个日期中减去一个日期,则会得到一个表示它们之间时间的时间跨度.
Have you tried anything at all ? Do you own any books on C# ?

If you subtract one date from another, you get a Timespan representing the time between them.


如果没有书籍,您会发现很多网站都在向您解释该日期.

现在,此链接MSDN应该足够了:
日期时间结构 [
If not books, you will find numerous websites explaining the same to you.

For now, this link MSDN should be enough:
DateTime Structure[^]