date format in node.JS

前端 未结 5 1952
一个人的身影
一个人的身影 2021-02-01 21:22

I am using mysql database,in that i have a field by name request_date. The type of the field is time stamp and the data stored in this field has the format 20

5条回答
  •  一生所求
    2021-02-01 21:35

    i got this working by requiring the library or module called date format. first we have to install date format package using

    npm install dateformat

    then u can require it in ur coding. then u can create the object of retrieved data as

    var day=dateFormat(result.request_date, "yyyy-mm-dd h:MM:ss");

    and print it.

提交回复
热议问题