Tell us what’s happening:
I can’t pass 6 and 9, I’ve done everything possible
i console log it and it returns the proper task
Your code so far
const currentDate = new Date();
const options = {
week: "short",
month: "short",
day: "2-digit",
year: "numeric",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
timeZoneName: "short"
}
const formattedTime = currentDate.toLocaleString('en-US', options)
const currentDateFormat = `Current Date and Time: ${formattedTime}`
console.log(currentDateFormat)
function formatDateMMDDYYYY(data) {
const format = data && data.date instanceof Date ? data.date : new Date()
const month = String(format.getMonth() + 1).padStart(2, '0');
const day = String(format.getDate()).padStart(2, '0');
const year = String(format.getFullYear())
return `Formatted Date (MM/DD/YYYY): ${month}/${day}/${year}`}
function formatDateLong(data){
const date = new Date(data)
const option = {
month: "long",
day: "numeric",
year: "numeric"
}
const formatted = date.toLocaleString('en-US', option)
return `Formatted Date (Month Day, Year): ${formatted}`
}
console.log(formatDateMMDDYYYY())
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:144.0) Gecko/20100101 Firefox/144.0
Challenge Information:
Build a Date Conversion Program - Build a Date Conversion Program