Create datetime by cet time formal(string)

Hello everyone!

string str= 2020-06-11 17:51
Datetime dt= Datetime.ParseExact(uTime, “yyyy-MM-dd hh:mm”, System.Globalization.CultureInfo.InvariantCulture)
Unfortunately can’t create datetime by CET time format, is there any solution for?

Thank you!

Use Datetime.ParseExact(uTime, "yyyy-MM-dd HH:mm", System.Globalization.CultureInfo.InvariantCulture).

The only difference here is the use of HH instead of hh for a 24-hour clock.


Cool thanks!