"原来在DOS下还可以用RUN命令直接调用系统命令DATE TIME来实现", 现在也应该可以.
用API也应该可以.

解决方案 »

  1.   

    下面是例子:
    在FORM里加入WS
    parameters wordvalprivate i, retstr
    retstr = ""
    for i = 8 to 0 step -8
    retstr = chr(int(wordval/(2^i))) + retstr
    wordval = mod(wordval, (2^i))
    next
    retu retstrdeclare SHORT SetLocalTime in win32api string SystemTimeSystemTime = thisform.ws(year(updtdate)) + ;
    thisform.ws(month(updtdate)) + ;
    thisform.ws(dow(updtdate) - 1) + ;
    thisform.ws(day(updtdate))+ ;
    thisform.ws(val(left(updtime, 2))) + ;
    thisform.ws(val(substr(updtime, 4, 2))) + ;
    thisform.ws(val(substr(updtime, 7, 2))) + ;
    thisform.ws(val(right(updtime, 2)))retval = SetLocalTime(SystemTime)完成。updtdate(你的日期),updtime(你的时间)