How do I change 1 date format to another in C# e.g 10/10/2014 to 2014-10-10 (Year-month-day) ?
The user selects a date with a datepicker, then it appears in the textbox but the format is 10/10/2014 (day/month/year). But I'm needing this output to be converted to reflect this format 2014-10-10 (Year-month-day)
Within asp.net-mvc
Code:
@Html.Label("Start", "Start Date:")
@Html.TextBox("Start", string.Empty, new {@id = "Start", @class = "datepicker"})
@Html.Label("endd", "End Date:")
@Html.TextBox("endd", string.Empty, new {@id = "End", @class = "datepicker"})
<input type="submit" value="Apply" id ="DateSelected" />