Format JavaScript date as yyyy-mm-dd
You can do: Usage example: Output: Demo on JSFiddle: http://jsfiddle.net/abdulrauf6182012/2Frm3/
You can do: Usage example: Output: Demo on JSFiddle: http://jsfiddle.net/abdulrauf6182012/2Frm3/
Angular.js has a built-in date filter. demo You can see the supported date formats in the source for the date filter. edit: If you’re trying to get the correct format in the datepicker (not clear if you’re using datepicker or just trying to use it’s formatter), those supported format strings are here: https://api.jqueryui.com/datepicker/
Use LocalDateTime#parse() (or ZonedDateTime#parse() if the string happens to contain a time zone part) to parse a String in a certain pattern into a LocalDateTime. Use LocalDateTime#format() (or ZonedDateTime#format()) to format a LocalDateTime into a String in a certain pattern. Or, when you’re not on Java 8 yet, use SimpleDateFormat#parse() to parse a String in a certain pattern into a Date. Use SimpleDateFormat#format() to format a Date into a String in a certain pattern. See also: Java string to date … Read more