I am using the open weather map API and I'm trying to figure out how to convert the date format which is by default "yyyy-mm-dd hh:mm:ss".
I would like to simply display the day such as "Tuesday" rather than the long output.
This is my first time working with an API and I'm just trying to learn. I have researched other topics on how to do this however I can't find any sources. Maybe I just don't know what exactly I should be looking for.
My code right now looks like this...
The final forecast function is where I am outputting the date with dt_txt.
    function forecastRequest() {
        //MAKE THE AJAX REQUEST
            $.ajax( {
                //DISPLAY WITH ZIPCODE API CALL
                url:'http://api.openweathermap.org/data/2.5/forecast?zip=49009' + ",us&units=imperial" +
                "&APPID=d9347e4e650b022f26f0990856107ac1",
                type: "GET",
                dataType: "jsonp",
                success: function(data){
                    //LOG THE SUCCESS FUNTION TO LET US KNOW IF WE ARE GETTING THE API CALL
                    console.log(data);
                    //SHOW THE DATA RESULTS FROM THE SHOW FUNCTION
                    var widget2 = forecast(data);
                    $("#forecast").html(widget2);
                }
            });
    } // End ajaxRequest Function
}); // End Document.Ready
//DISLAY THE RESULTS
function show(data){
    return   "<h1 class='temp'>" + data.main.temp + "°</h1>" ; 
}
function forecast(data) {
    return   "<p class='temp'>" + data.list[0].main.temp + "° " + data.list[0].dt_txt + "</p>" +
             "<p class='temp'>" + data.list[1].main.temp + "° " + data.list[1].dt_txt + "</p>";
}
 
    