Hi,
I have a field in a web part with a Data type of "Date and time"
The data resolves as
GetValue("Time")| "3/25/2020 12:50:06 PM" | object {string}
When I try to parse the selected date in the web part code using standard "DateTime.parse()" I get the error: String was not recognized as a valid DateTime
When I try to use Kentico ValidationHelper it parses the default value.
ValidationHelper.GetDateTime(GetValue("Time"), DateTime.MinValue) | {01/01/0001 00:00:00} | System.DateTime
Why can't I parse the output of this field as a c# DateTime?
Turns out it was because of the American date format.
Please, sign in to be able to submit a new answer.