“hh” is the 12-hour clock format (01 to 12). You need to use “HH” for a 24 hour clock.
DateTime dt = DateTime.ParseExact(time, "HH:mm", CultureInfo.InvariantCulture);
More Related Contents:
- DateTime and CultureInfo
- Days between two dates in asp.net
- Convert DateTime to Date string “dd/mm/yyyy”
- How do I calculate someone’s age based on a DateTime type birthday?
- How to use localization in C#
- C# DateTime.Now precision
- format date in c#
- What does “DateTime?” mean in C#?
- Environment.TickCount vs DateTime.Now
- How do I convert an ISO8601 TimeSpan to a C# TimeSpan?
- Setting Culture (en-IN) globally in WPF application
- Why DateTime.AddHours doesn’t seem to work?
- How to convert Javascript datetime to C# datetime?
- How to find the 3rd Friday in a month with C#?
- Using DateTime in a SqlParameter for Stored Procedure, format error
- String sorting issue in C#
- How can I format a nullable DateTime with ToString()?
- What’s a good way to overwrite DateTime.Now during testing?
- why does DateTime.ToString(“dd/MM/yyyy”) give me dd-MM-yyyy?
- Datetime in C# add days
- datetime to string with time zone
- How do I get modified date from file in C# on Windows Mobile?
- How frequent is DateTime.Now updated ? or is there a more precise API to get the current time?
- Parse a string containing date and time in a custom format
- How can i format 07/03/2012 to March 7th,2012 in c# [duplicate]
- Adding a Time to a DateTime in C#
- Format string by CultureInfo
- Datetime format Issue: String was not recognized as a valid DateTime
- How to receive event when user changes system’s culture
- Convert string to datetime Using C#