Tell us what’s happening:
my code is not passing the sixth checker and the code is correct
Your code so far
const currentDate = new Date();
const currentDateFormat = `Current Date and Time: ${currentDate}`;
console.log(currentDateFormat);
function formatDateMMDDYYYY(date) {
const mm = String(date.getMonth());
const dd = String(date.getDate());
const yyyy = date.getFullYear();
return `Formatted Date (MM/DD/YYYY): ${mm}/${dd}/${yyyy}`;
}
console.log(formatDateMMDDYYYY(currentDate))
function formatDateLong(date) {
const mm = date.toLocaleString("en-Us", {month: "long"});
const dd = String(date.getDate());
const yyyy = date.getFullYear();
return `Formatted Date (Month Day, Year): ${mm +" "+ dd + ", " + yyyy}`;
}
console.log(formatDateLong(currentDate))
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36
Challenge Information:
Build a Date Conversion Program - Build a Date Conversion Program
https://www.freecodecamp.org/learn/full-stack-developer/lab-date-conversion/lab-date-conversion