Hello Guys..

I am working in VB.NET
I have to textbox : txtStartTime and txtEndTime
After filling in values i need to validate that Start time must be less then Endtime. Values are entered in 12 hour format like
08:32 AM

I can go for sub string logic and split by : and all .. but that is old logic and tidy..
Can anyone give me function with some tricks which is short code???
Code will be Helpful:)
Thanks

Recommended Answers

All 4 Replies

Something like

Convert.ToDateTime(txt1.Text) < Convert.ToDateTime(txt2.Text)

You can also use DateTime.TryParse()

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.