开发者

What was the date 180 days ago?

开发者 https://www.devze.com 2022-12-20 20:43 出处:网络
How wo开发者_如何学Pythonuld I get the date 180 days ago using C#?DateTime oneEightyAgo = DateTime.Today.AddDays(-180);

How wo开发者_如何学Pythonuld I get the date 180 days ago using C#?


DateTime oneEightyAgo = DateTime.Today.AddDays(-180);


EDIT:

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

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


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

Its best to record UTC...


DateTime.Now.AddDays(-180)


DateTime.Now.AddDays(-180)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号