Insert MySQL date using NodeJS
我想使用NodeJS插入一个MySQL日期,但是它不起作用。
我的新date:
在NodeJS插入之后:
NodeJS插入:
1 2 3 |
使用Javascript的
1 |
如果我添加插入日期的一小时,则可以使用。
您需要在Sequelize中设置
[options.timezone='+00:00'] The timezone used when converting a date from the database into a JavaScript date. The timezone is also used to SET TIMEZONE when connecting to the server, to ensure that the result of NOW, CURRENT_TIMESTAMP and other time related functions have in the right timezone. For best cross platform performance use the format +/-HH:MM. Will also accept string versions of timezones used by moment.js (e.g. 'America/Los_Angeles'); this is useful to capture daylight savings time changes.
同步连接
1 |