How to format the date returned by pug template engine rendering

return data to the page

exports.renderProjectList = async (ctx) => {
    let list = await projectDao.list(ctx.state.page.page, ctx.state.page.size)
    await ctx.render("projectList", {
        list: list,
        csrf: ctx.csrf
    })
}

render data:

td= l.createAt

effect is shown in figure

clipboard.png

the project has referenced moment.js,. How do I format the date?

I used the js conversion function in the project, and I also tried moment, but after the conversion was unsuccessful, there was no change, but any date passed in can be successfully converted.

for(let l of list){
        l.createAt =new Date(l.createAt).toLocaleString()
        l.updateAt=new Date(l.updateAt).toLocaleString()
        console.log(l.createAt) //2018-06-05T06:31:49.000Z

    }
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2c1a9-e038.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2c1a9-e038.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?