NodeJS连接mysql问题

返回时间格式不对

添加时区配置 timezone: “08:00”

    connectionLimit: 100,
    host: '',
    port: '',
    user: '',
    password: '',
    database: '',
    timezone: "08:00",

默认返回时间格式

        {
            "id": "2a8e9c30a3c711eaa7abc546b97069b8",
            "user_id": "b6a0a0d177ec11eaba27525400ced584",
            "name": "****",
            "count": 20,
            "bill_date": "2020-05-31T16:00:00.000Z",
            "remarks": null,
            "create_time": "2020-06-01T05:17:19.000Z",
            "update_time": null
        },

添加时区后返回

        {
            "id": "2a8e9c30a3c711eaa7abc546b97069b8",
            "user_id": "b6a0a0d177ec11eaba27525400ced584",
            "name": "****",
            "count": 20,
            "bill_date": "2020-06-01",
            "remarks": null,
            "create_time": "2020-06-01 13:17:19",
            "update_time": null
        },

连接超时

添加超时配置

    connectionLimit: 100,
    host: '',
    port: '',
    user: '',
    password: '',
    database: '',
    timezone: "08:00",
    acquireTimeout: 1000 * 20
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章