You can use the Date constructor to create a new Date object and then use the various methods on that object, such as getFullYear(), getMonth(), getDate(), getHours(), getMinutes(), and getSeconds(), to extract the various components of the date and time, which can then be formatted using a library, such as moment.js, or in a custom way.