What was the date 180 days ago?

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

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

5条回答
  •  -上瘾入骨i
    2021-02-18 14:22

    DateTime oneEightyAgo = DateTime.Now.ToUniversalTime().AddDays(-180); 
    

    Its best to record UTC...

提交回复
热议问题