if (ts1.CompareTo(DateTime.Now) == -1 && ts2.CompareTo(DateTime.Now) == -1)
            {
                MessageBox.Show("....");
            }

the function asks for a object, i gave an object...

Recommended Answers

All 2 Replies

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.