how to format date to mm/dd/yyyy in javascript code example Example: javascript format date yyyy-mm-dd let today = new Date() today.toISOString().split('T')[0]