我不熟悉mysql查询和存储过程。 我从印度工作,我想要我们的时区。 因为我用的是set currTimeStamp = date(UTC_TIMESTAMP + interval 5 hour + interval 30 minute);
set currDate = date(UTC_DATE() + interval 5 hour + interval 30 minute);
-- insert into oc_product
insert into oc_product (model, ean, jan, isbn,mpn,location, stock_status_id,manufacturer_id,tax_class_id, date_available,
date_added,date_modified, image, weight, length, width, height, upc, price, sku, from_edi )
SELECT '','','','','','','','','',currDate, currTimeStamp , currTimeStamp , w.image, w.weight, w.length, w.width,
w.height, w.upc, w.price, w.sku, 1 FROM tmp_product_insert as w left join oc_product as ocp on (ocp.sku <> w.sku
and ocp.from_edi=1) where ocp.product_id IS NULL;
当我试图在本地数据库中打印时,它显示date(UTC_TIMESTAMP + interval 5 hour + interval 30 minute)
2020-07-13
但我想要2020-07-13 15:15:30的格式。
对于currTimeStamp变量,我们需要yyyy-mm-dd H:I:S格式,对于currdate变量,我们需要yyyy-mm-dd格式。 我们怎样才能在查询中得到这个。 我在上面添加了查询。
高级感谢