How can I subtract 2 minutes from the current time, and then get data at that particular time?
Printable View
How can I subtract 2 minutes from the current time, and then get data at that particular time?
To substract two minutes to the current time, you need to do this:
DateTime twoMinutesAgo = DateTime.Now - TimeSpan.FromMinutes(2);
I'm not sure what do you mean by "get data at that particular time". Are you working with some sort of database?