我正在使用sequelize的2.0.0-rc8版本.当我存储本地日期时间时,它始终存储UTC日期时间.是否可以使用sequelize存储本地日期时间?
我执行以下查询,但出现错误。我想要我最后发布的 SQL 查询的结果。
userServiceAppointmentModel.findAll({
where: {
technician_id: resultsFromAuthentication.technician_id,
is_confirmed_by_user: 1,
$or: {
service_start_time: {
gte: curLocalDate
},
service_running_status: 1
}
},
attributes: attributes
}).complete(function (err, appointmentResponse) {
if (err) {
console.log(err);
}
SELECT
`id`, `technician_id`, `user_id`, `service_id`, `service_name`,
`service_location_string`, `service_location_latitude`,
`service_location_longitude`, `service_start_time`, `service_end_time`,
`notes`, `total_cost`, `service_cost`, `is_confirmed_by_user`,
`is_confirmed_by_technician`, `service_running_status`,
`service_start_time_by_technician`,`service_complete_time_by_technician`
FROM `user_service_appointment` AS `user_service_appointment`
WHERE `user_service_appointment`.`technician_id`=154
AND `user_service_appointment`.`is_confirmed_by_user`=1
AND (`user_service_appointment`.`service_start_time` >='2015-02-26 01:07'
OR `user_service_appointment`.`service_running_status`=1)
Run Code Online (Sandbox Code Playgroud) 当我运行这个 sql 命令时:
UPDATE chat_data
SET message = replace(message, '\', '')
LIMIT 1 ;
Run Code Online (Sandbox Code Playgroud)
它给了我语法错误:
13:07:46 更新 chat_data SET message = replace(message, '\', '') LIMIT 1 ; 错误代码:1064。您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以获取在第 1 行 0.237 秒附近 ''\', '') LIMIT 1' 附近使用的正确语法
有什么解决办法吗?