All other answers don't quite solve the issue. They print the date formatted as mm/dd/yyyy but the question was regarding MM/dd/yyyy. Notice the subtle difference? MM indicates that a leading zero must pad the month if the month is a single digit, thus having it always be a double digit number. i.e. whereas mm/dd would be 3/31, MM/dd would be. A variable of type Date or an object Date contains a value representing a Date or DateTime. This is an internal format suited for comparing 2 Dates. The internal format can be like yyyymmdd. There is no format conversion when copying a Date to a Date. There format conversion on when you convert a String to a Date or a Date to a String. Convert string of "dd/MM/yyyy" format into Datetime using C? I am using the code below to convert my string which is in the format "dd/MM/yyyy" into datetime //DateStr = 19/02/2017 for example Datetime date. A few of the previous answer were OK, but they weren't very flexible. I wanted something that could really handle more edge cases, so I took @orangleliu 's answer and expanded on it.
You have non-date data in the date column, which means that DataTables cannot correctly detect the date and thus is treating it as a string. You would need to have a custom ordering plug-in that would strip out all the non-date information and just leave the date value. jQueryのdateFormatは別のプラグインです。