Hacker News new | ask | show | jobs
by tizoc 4563 days ago
From where is that?

This is how it works in C# (and .NET in general)

DateTime.Now.AddDays(-2)

Not wanting to overload integers with calendar functionality doesn't mean you have to make it so cumbersome.

Edit: typo

1 comments

You can also do:

  DateTime.Now - TimeSpan.FromDays(2)