SOURCE

let result = {"Name":"fr-prd-sha-lowcode-store-biz-hour-1304179244","Prefix":"","Marker":"","MaxKeys":"1000","IsTruncated":"false","Contents":[{"Key":"store-biz-hour/","LastModified":"2023-06-05T06:50:27.000Z","ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":"0","Owner":{"ID":"1304179244","DisplayName":"1304179244"},"StorageClass":"MAZ_STANDARD"},{"Key":"store-biz-hour/20230616/","LastModified":"2023-06-16T05:58:12.000Z","ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":"0","Owner":{"ID":"1304179244","DisplayName":"1304179244"},"StorageClass":"MAZ_STANDARD"},{"Key":"store-biz-hour/20230616/standard2023061601.xlsx","LastModified":"2023-06-16T05:58:19.000Z","ETag":"\"7a30e60df7e7b492f982efe076a768db\"","Size":"18031","Owner":{"ID":"1304179244","DisplayName":"1304179244"},"StorageClass":"MAZ_STANDARD"},{"Key":"store-biz-hour/20230618/special2023061801.xlsx","LastModified":"2023-06-18T00:45:05.000Z","ETag":"\"a129797a433e5cd219b0276b0b269b2c\"","Size":"16665","Owner":{"ID":"1304179244","DisplayName":"1304179244"},"StorageClass":"MAZ_STANDARD"}],"CommonPrefixes":[],"statusCode":200,"headers":{"content-type":"application/xml","content-length":"1564","connection":"keep-alive","date":"Mon, 19 Jun 2023 01:11:06 GMT","server":"tencent-cos","x-cos-bucket-region":"ap-shanghai","x-cos-request-id":"NjQ4ZmFiMjlfMWMxM2IwMDlfY2ViZl9kZDQzYmI="},"RequestId":"NjQ4ZmFiMjlfMWMxM2IwMDlfY2ViZl9kZDQzYmI="}

result.Contents.map(item =>{
    item.LastModified = getFormatDate(item.LastModified)
})

console.log(result.Contents)


function getFormatDate(time) {
    var date = new Date(time);
    var month = date.getMonth() + 1;
    var day = date.getDate();
    var hour = date.getHours();
    var minutes = date.getMinutes();
    var seconds = date.getSeconds();
    month = (month<10)? '0'+ month : month;
    day = (day<10)? '0'+ day : day;
    hour = (hour<10)? '0'+ hour : hour;
    minutes = (minutes<10)? '0'+ minutes : minutes;
    seconds = (seconds<10)? '0'+ seconds : seconds;
    var currentDate = date.getFullYear() + "-" + month + "-" + day
            + " " + hour + ":" + minutes + ":" + seconds;
    return currentDate;
}
console 命令行工具 X clear

                    
>
console