Live Chat Icon For mobile
Live Chat Icon

How to convert string to a DateTime and compare it with another DateTime

Platform: ASP.NET| Category: Basic

VB.NET


Dim blntimeIsOk As Boolean = DateTime.Parse('15:00') < DateTime.Parse('08:00')
Response.Write(blntimeIsOk)

C#


bool blntimeIsOk = (DateTime.Parse('15:00') < DateTime.Parse('08:00'));
Response.Write (blntimeIsOk);

Share with

Share on twitter
Share on facebook
Share on linkedin