TimeSpan -Negative() ?

G

Guest

You can check any of the total values:
TotalDays, TotalHours, TotalMinutes, TotalSeconds, TotalMilliseconds.
If the time is only a few milliseconds different then all of these values
will be zero, except TotalMilliseconds, which will be negative.

Rick D.
Contractor
 
G

Guest

Thank you,
But i don't see how can i use .Negative function?
or How can check .TotalHours is negative?
 
P

Peter Foot [MVP]

You can use

if(mytimespan.CompareTo(TimeSpan.Zero) < 0)
{
//your timespan is negative
}

Peter
 

Ask a Question

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.

Ask a Question

Top