以下是引用wxzd123在2022-1-21 07:42:39的发言:
谢谢各位老师的帮助
con = Sqlstringconnect([Driver={SQL Server};Server=192.168.1.111;UID=sa;PWD=a;Database=hztx])
SQLEXEC(con,"select getdate() as fwqsj","fwqsj")
i=fwqsj.fwqsj
DECLARE SHORT SetLocalTime IN win32api STRING SystemTime
cBuf=bintoc(YEAR(i),"2rs")+bintoc(MONTH(i),"2rs")+bintoc(DOW(i)-1,"2rs")+bintoc(DAY(i),"2rs")+bintoc(HOUR(i),"2rs")+bintoc(MINUTE(i),"2rs")+bintoc(SEC(i),"2rs")+bintoc(0,"2rs")
=SetLocalTime(cBuf) &&设置系统日期
这样没有成功,时间没变?
SQLEXEC(con,"select convert(varchar(19),getdate(),120) as fwqsj","fwqsj")
i=fwqsj.fwqsj
j=datetime()
?type("i"),type("j") && 对比一下,是不是相同,我记得,这样转换后,I好像是C,如果是C,就转换一下,用CTOD()