python mssql insert 插入datetime类型

为了方便记忆,没什么详细讲解

sql="insert into t_goods_charge_log(Goods_Id,Order_Count,User_Id,Rmb,Status,Remark,Charge_Channel_Id,Order_SerialNumber,Adddate) \

    values('%d','%d','%d','%d','%d','%s','%d','%s',getdate())" %(goods_id,order_count,User_Id,Rmb,0,'beizhuc123',Charge_Channel_Id,order_serialnumber)

getdate()可获取当前时间  如格式(2014-04-17 11:53:37.543) 插入到sql数据库

你可能感兴趣的:(Python)