You can use AddMonths method and pass -12 as the parameter. Which basically subtracts 12 months from the date. Basically the method does both add and subtract
You can use AddMonths method and pass -12 as the parameter. Which basically subtracts 12 months from the date. Basically the method does both add and subtract.
You can get different string representations of the date by passing
parameters to the ToString method on the DateTime instance. Check out the
documentation for the DateTimeFormatInfo class to find the string formats
you can pass to the ToString method to output different formats for the
DateTime instance.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
basically subtracts 12 months from the date. Basically the method does both
add and subtract.
You can get different string representations of the date by passing
parameters to the ToString method on the DateTime instance. Check out the
documentation for the DateTimeFormatInfo class to find the string formats
you can pass to the ToString method to output different formats for the
DateTime instance.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.