I am working with a JavaScript AJAX code:
success:function(res){
var _html='';
var json_data=$.parseJSON(res.posts);
$.each(json_data,function (index,data) {
_html+='<span class='time'>'+data.fields.time+'</span>';
});
$(".post-wrapper").append(_html);
}
The problem I am facing is that the time format appears as follows:
2021-08-05T22:10:55.255Z
How can I adjust this date format to something like:
2021-08-05 22:10