Unlike the U.S.A ... most other countries uses the dd/MM/yyyy format (from smallest to biggest). However, .NET naturally takes in date in MM/dd/yyyy format.
I have an input that accepts a datetime, and the user will want to type in the date in dd/MM/yyyy format, let's say they type in 30/1/2017 ... but when that date is posted in the backend, it becomes unrecognized.. or it becomes reversed (1/2/2017 becomes 2/1/2017).
[HttpPost]
public ActionResult Save(DateTime date) // user entered 1/2/2017 from front-end
{
date.ToString("dd/MM/yyyy"); // this becomes 2/1/2017
}
Is there some kind of global setting to reverse this recognization of date in .NET? I would not like to manually switch dates from front-end because that seems like alot of work and alot of places to do it from.