I want to subtract from a DateTime.
Example:
date1 = 13/01/2004 12:20:00
result = Subtract(date1-15);
Output:
13/01/2004 12:05:00
How do I do this?
I want to subtract from a DateTime.
Example:
date1 = 13/01/2004 12:20:00
result = Subtract(date1-15);
Output:
13/01/2004 12:05:00
How do I do this?
You may take a look at the AddMinutes method:
var result = date1.AddMinutes(-15);
Use DateTime.Add(TimeSpan) with a negative value
Or DateTime.AddDays(), .AddMinutes(), etc