[求助]如何用程序改变系统日期
请各位大侠帮助小弟一下,我不知道在VFP中如何用程序改变当前日期,请告知方法,不胜感激
clear
local cbuffer,ttime,nyear,nmonth,ndayofweek,nday,;
nhour,nminute,nsecond,nmilliseconds,nresult
set date ansi
set century on
set hours to 24
nyear=2001
nmonth=1
ndayofweek=dow(ctod("2001.1.1"))-1
nday=1
ttime=time()
nhour=val(substr(ttime,1,2))
nminute=val(substr(ttime,1,2))
nsecond=val(substr(ttime,7,2))
nmilliseconds=0
cbuffer=h2str(nyear)+h2str(nmonth)+h2str(ndayofweek)+h2str(nday)+;
h2str(nhour)+h2str(nminute)+h2str(nsecond)+h2str(nmilliseconds)
declare long setlocaltime in kernel32 string lpsystemtime
nresult=setlocaltime(cbuffer)
if nresult=0
=messagebox("无法完成日期时间设置")
endif
clear dlls
function h2str
parameters zhsz
private fhz
fhz=chr(zhsz%256)+chr(zhsz/256)
return fhz
endfunc