0

I have a PatientSearchCriteriaBinder and when runs it call a DateTimeBinder.

The first time it occurs, everything goes well. But, I don't know why. When I do in my controller the RedirectToAction is runs the Binder again and the Date format changes from dd/MM/yyyy to MM/dd/yyyy

Could anyone help me out?

  • 1
    Possible duplicate of [MVC3 en-GB dates in Get](http://stackoverflow.com/questions/9821407/mvc3-en-gb-dates-in-get) – Liam Jul 19 '16 at 10:59
  • 1
    How is the binding meant to know that the date format has "changed" between these formats? This can't be determined from the date value alone as some values will be ambiguous; does 03/04/2016 mean the 3rd of April, or March 4? – Richard Ev Jul 19 '16 at 12:55
  • I've solved this by changind the version of jQuery. Also, I realized I had jQueryUI in the project. jQueryUI datepicker conflits with the bootstrap datepicker settings. – Tuga_Coder May 02 '18 at 11:40
  • A general rule of thumb is to use the "round-trip" format (`theDateTime.ToString("o")`) when sending dates as strings over the wire. This format is unambiguous. See [How to: Round-trip Date and Time Values](https://learn.microsoft.com/en-us/dotnet/standard/base-types/how-to-round-trip-date-and-time-values). – Georg Patscheider May 02 '18 at 13:29

0 Answers0