Lee,
What you want to do is create an instance of the TimeSpan class, and
then subtract that from your DateTime instance. You can also call the
AddDays, AddHours, etc, etc methods on the DateTime instance, passing
negative numbers to subtract the values from the DateTime. Note that these
methods return a new DateTime instance with the modified value, as opposed
to modifying the current value.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Lee" <la*******@spamless.hotmail.com> wrote in message
news:uU*************@TK2MSFTNGP12.phx.gbl...
Hi All,
I have a datetime field and want to subtract 24 (or any other number of)
hours from it.
How would I go about this?
Thanks
Lee