出现此错误:- 日期时间值不正确:第 1 行的“cdate”列为“2022-05-23T20:51:48+05:30”
我的桌子是这种形式:-
create table if not exists amplitude_enable (
cid int not null primary key,
idc varchar(255),
apiurl longtext,
timezone varchar(255),
status varchar(255),
cdate datetime not null,
udate datetime not null,
primary_key varchar(255) not null,
apikey varchar(255) not null
);
代码:-
dt := time.Now().Format(time.RFC3339)
primary_key := "email" //function
queryStr := fmt.Sprintf("INSERT INTO amplitude_enable (cid, idc, apiurl, timezone, cdate, udate, primary_key, apikey) value(%f, '%s','%s','%s','%s','%s', '%s', '%s') on duplicate key update apiurl='%s', idc='%s', timezone='%s', udate='%s', apikey='%s'", cid.(float64), idc.(string), apiurl.(string), timezone.(string), dt, dt, primary_key, apikey.(string), apiurl.(string), idc.(string), timezone.(string), dt, apikey.(string))
如何修复此错误?
陪伴而非守候
相关分类