i have a property in the following way to keep datetime information
public string ExecutionTime{ get; set; }
ExecutionTime value is set as dd-MM-yyyy hh:mm:ss tt
How can i change the property value to appear as yyyy-MM-dd hh:mm:ss tt and show in a textbox.
As your date is stored as
string:DateTimestringwith different formatYou’ll need ParseExact:
But you really should store a date as
DateTime, notstring.