I am using a variable in my code which is a datetime.
I need to convert this to a format which is "yyyy-mm-dd".
How could i do this in c#.
Here is my code
private DateTime DateofBirth
DateofBirth = mm/dd/yyyy 12:00 AM
I need to convert this to YYYY-MM-DD.