if (ts1.CompareTo(DateTime.Now) == -1 && ts2.CompareTo(DateTime.Now) == -1)
{
MessageBox.Show("....");
}
the function asks for a object, i gave an object...
if (ts1.CompareTo(DateTime.Now) == -1 && ts2.CompareTo(DateTime.Now) == -1)
{
MessageBox.Show("....");
}
the function asks for a object, i gave an object...
Because it's not a TimeSpan. Use DateTime.Now.TimeOfDay
. That is if ts1 is of type TimeSpan.
Works with me if ts1 and ts2 are DateTimes.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.