how to get dd-mm-yyyy format using new Date code example Example: js date format yyyy-mm-dd yourDate.toISOString().split('T')[0]