How to Compare a Time String with DateTime.Now

Posted by lolalola on Stack Overflow See other posts from Stack Overflow or by lolalola
Published on 2010-04-27T20:56:00Z Indexed on 2010/04/27 21:03 UTC
Read the original article Hit count: 249

Filed under:
|
|

I have time from DB:

string user_time = "17:10:03"; //Hours:minutes:seconds
DateTime time_now = DateTime.Now;

How do I compare the time? How make same like this:

if(time_now > user_time)
{
    //Do something
}
else
{
  //Do something
}

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET