如何使用java在SQL工作台中存储数据时间?我试图这样做,但失败了。要使用Java按顺序列插入当前日期时间
insert into customer_order (idCustomer_Order,Customer_id,Total_Amount,Payment,Order_date,Order_month,Order_year,Delivery_date,Delivery_month,Delivery_year,product_id,OrderDate)value(3,1,122,'payed',3,2,4,2,3,4,4,curdate())我试过了,但时间是00:00 3 1 122支付3 2 2 3 4 4 2017-12-28 00:00:00
发布于 2017-12-27 20:52:03
我使用的是curDate(),所以如果我使用current_timestamp()而不是获取日期和时间,那么只有日期被插入到数据库中。
insert into customer_order (OrderDate)value(current_timestamp())产出为2017-12-28 01:48:31
https://stackoverflow.com/questions/47998354
复制相似问题