Date and time in JavaScript are represented with the Date object. The Intl.DateTimeFormat object is a constructor for objects that enable language-sensitive date and time formatting. It provides a number of built-in methods for formatting and managing that data. The toLocaleDateString() method accepts two arguments, which are locales and options. Formatting date. Months are counted from zero (yes, January is a zero month). JavaScript Demo: Intl.DateTimeFormat. Change Date Format dd-mmm-yyyy. The above shown date time is the default format. We can’t create “only date” or “only time”: Date objects always carry both. By default, a new Date instance without arguments provided creates an object corresponding to the current date and time. The Date object is a built-in object in JavaScript that stores the date and time. JavaScript JavaScript Reference HTML DOM Reference jQuery Reference AngularJS … To convert date to format dd-mmm-yyyy you need to extract the date, month and year from the date object. It’s not so straight to change JavaScript date time format. JavaScript ISO Dates ISO 8601 is the international standard for the representation of dates and times. JavaScript Date Time Format. JavaScript Date object comes with different type of date and time methods.But we are using toLocaleDateString() and toLocaleTimeString() methods. The ISO 8601 syntax (YYYY-MM-DD) is also the preferred JavaScript date format: Locale means the type of local language you need to format.