Um, or you could just really use the TimeOfDay property, like Peter
said:
TimeSpan ts1 = dtdate1.TimeOfDay;
TimeSpan ts2 = dtdate2.TimeOfDay;
And then compare those. No need to perform an extra operation when the
logic is encapsulated for you already.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Paul" <Pa**@discussions.microsoft.comwrote in message
news:99**********************************@microsof t.com...
looks easy to impliment! Thanks for the additional information.
--
Paul G
Software engineer.
"Ignacio Machin ( .NET/ C# MVP )" wrote:
>Hi,
IT can be as easy as getting the timespan from the start of the day:
TimeSpan ts1 = dtdate1.Substract( dtdate1.Today);
TimeSpan ts2 = dtdate2.Substract( dtdate1.Today);
Now you can compare them. as either numeric (Total(Minutes/second,
tc) )
--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
"Paul" <Pa**@discussions.microsoft.comwrote in message
news:D6**********************************@microso ft.com...
Hi I am trying to compare just the time portion of two variables that
are
of
date time part. For example I have
dtdate1= 2/2/07 10:00:00
dtdate2=3/4/07 9:00:00
so for the comparision I would want 10:00:00 cmp with 9:00:00
so ddate1>ddate2 is true.
I tried converting to short time string but the comparison can not be
done
on the strings.
Thanks Paul.
--
Paul G
Software engineer.