On May 22, 11:01 am, Lars Schouw <schou...@yahoo.comwrote:
I just read the documentaion quickly does TimeSpan also work with
years, months, weeks?
I can find days.
Months and years vary in length, so you'll need to work out exactly
what you mean. If you want to add 1 year to Jan 1st and always get Jan
1st, you may want to look at adding each field individually rather
than using TimeSpan: DateTime has AddYears and AddMonths methods.
(Note that these return new DateTime values - DateTime itself is
immutable.)
Weeks is just a matter of multiplying by 7 and treating as days.
Jon