DateTime Subtract methodshttp://forums.asp.net/t/976219.aspx/1?DateTime+Subtract+methodsWed, 29 Mar 2006 14:27:01 -05009762191238939http://forums.asp.net/p/976219/1238939.aspx/1?DateTime+Subtract+methodsDateTime Subtract methods <p>Hello,</p> <p>The DateTime class has AddMonth, AddDay, etc members; I had a use for it to have SubtractDay, SubtractMonth members as well.&nbsp; That would be a nice feature to have.&nbsp; I have a process that has to archive one month or more old data, and it would be nice to be able to use this method rather than using a special method of mine.</p> <p>Thanks.</p> 2006-03-27T14:20:09-05:001239003http://forums.asp.net/p/976219/1239003.aspx/1?Re+DateTime+Subtract+methodsRe: DateTime Subtract methods You mean using AddDay(-1) for subtraction isn't an option for you?&nbsp; Just curious since this question has come up in the past. 2006-03-27T15:05:41-05:001240016http://forums.asp.net/p/976219/1240016.aspx/1?Re+DateTime+Subtract+methodsRe: DateTime Subtract methods <p>Hey,</p> <p>As an alternative, I suggested storing 30 days worth, rather than one days worth; but if i'm on feb 28th; I would only want data from jan 31 to feb 28, not jan 28 to feb 28 for one month.</p> <p>Thanks.</p> 2006-03-28T12:06:51-05:001241556http://forums.asp.net/p/976219/1241556.aspx/1?Re+DateTime+Subtract+methodsRe: DateTime Subtract methods <p>You are looking for the Month/Year version of Time Interval and it is&nbsp;already there, the first link covers what you are looking for.&nbsp; February being 28/29 is the reason there are two Time Interval Day/Hours and Month/Year.&nbsp;&nbsp; Try the links below for details.&nbsp; Hope this helps.</p> <p class="MsoNormal" style="margin:0in 0in 0pt">&nbsp;</p> <p class="MsoNormal" style="margin:0in 0in 0pt"><a href="http://msdn2.microsoft.com/en-us/library/system.datetime.op_subtraction(VS.80).aspx">http://msdn2.microsoft.com/en-us/library/system.datetime.op_subtraction(VS.80).aspx</a> </p> <p class="MsoNormal" style="margin:0in 0in 0pt"><a href="http://msdn2.microsoft.com/en-us/library/system.datetime.subtract(VS.80).aspx">http://msdn2.microsoft.com/en-us/library/system.datetime.subtract(VS.80).aspx</a> </p> <p>&nbsp;</p> 2006-03-29T14:27:01-05:00