C#
DateInput is of DateTime type.
ExpirationDate comes from an out arguments that contain extracted dates from different websites.
So If I assign DateInput=DateTime.Parse(ExpirationDate)- It throws an error that the string was not recognized as valid datetime
Tried using Convert.todatetime(Expirationdate) and got the same error
Error I get is String was not recognized as valid date Time
(I want to check if DateInput<Datetime.Now, so I need DateInput in datetme format only)
Show us the string value. Parse uses your system default datetime format to try to parse it. So if the string is in a different format you have to use ParseExact and specify the format.