Solved

How can I compare 2 DateTimePicker control (configre to display only time) for the time and not the date?

Posted on 2006-12-01
1
252 Views
Last Modified: 2008-02-01
I'm using the following code but it's using the Date of the control and time during the comparison.  I only want to compare the time,   how can I do that?  Thanks.
 if ((toTime.Value.CompareTo(fromTime.Value)) < 0)
0
Comment
Question by:lapucca
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 18

Accepted Solution

by:
Ravi Singh earned 500 total points
ID: 18058587
Hi, you can use the TimeOfDay property on the DateTime object:

if (toTime.Value.TimeOfDay < fromTime.Value.TimeOfDay)
{
             
}
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A short article about problems I had with the new location API and permissions in Marshmallow
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question