A,
It is =)
If you have two variables of type DateTime, you can do this:
// The first date.
DateTime pdatStart = DateTime.Now;
// Wait for two seconds.
Thread.Sleep(2000);
// Get the time.
DateTime pdatEnd = DateTime.Now;
// Get the difference.
TimeSpan pobjDifference = pdatEnd - pdatStart;
The TimeSpan class is used to handle differences in datetime values.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"A" <NO****@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Hi Group,
Coming from a VB background I am looking for the quickest path to do a
date diff in C#. I see that C# has no date diff function so this must be more
obvious than it looks.
Thanks