What was the date 180 days ago?

后端 未结 5 1580
遇见更好的自我
遇见更好的自我 2021-02-18 13:55

How would I get the date 180 days ago using C#?

5条回答
  •  无人共我
    2021-02-18 14:07

    EDIT:

    DateTime day180 = Date.Now.AddDays(-180);
    

    It's important to put it into a separate variable otherwise the value will be lost.

提交回复
热议问题