How to compare time
Hello Experts.....How can I compare if the entered time is LESS than the current time?...Thanks in advance
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Benjamin KemnerRank #7,492 · 240 reputationPosted Jul 28, 2011, 3:39 AM EDT
if (dateTimePicker1.Value < DateTime.Now)
MessageBox.Show("It is before now!");
Shivaraj Poojary69 reputationPosted Jul 28, 2011, 3:42 AM EDT
Benjamin KemnerRank #7,492 · 240 reputationPosted Jul 28, 2011, 3:48 AM EDT
if(DateTime.Parse(textBox1.Text) < DateTime.Now)
MessageBox.Show("It is before now!");
Shivaraj Poojary69 reputationPosted Jul 28, 2011, 3:58 AM EDT
Mahesh ChandRank #1 · 393.3K reputationPosted Jul 28, 2011, 4:09 AM EDT
Jiteendra SampathiraoRank #585 · 4.1K reputationPosted Jul 28, 2011, 4:35 AM EDT
String.Format("{0:t}", dt); // "4:05 PM' //ShortTime
Link2
hope it help you......
VulpesRank #55 · 29.2K reputationPosted Jul 28, 2011, 5:30 AM EDT