* This function sets the date and time of the workstation to the value passed as parameter * Return Type: 'L' (Logical, .t. if succeed) lparameters ltDateTime local cTime, cYear, cMonth, cDayOfWeek, cDay, cHours, cMinutes, cSeconds, cMilliSeconds if vartype(ltDateTime)#'T' return .f. endif declare SetLocalTime in kernel32 string @ cTime cTime=replicate(' ', 16) cYear=n2ws(year(ltDateTime)) cMonth=n2ws(month(ltDateTime)) cDayOfWeek=n2ws(dow(ltDateTime)) cDay=n2ws(day(ltDateTime)) cHours=n2ws(hour(ltDateTime)) cMinutes=n2ws(minute(ltDateTime)) cSeconds=n2ws(sec(ltDateTime)) cMilliSeconds=' ' cTime=cYear+cMonth+cDayOfWeek+cDay+cHours+cMinutes+cSeconds+cMilliSeconds return SetLocalTime(@cTime) *------------------------------------------------------------------------------ * function n2ws * * Converts a number into a 2 chars string (Number to Word String) function n2ws(nNumber) return chr(nNumber%256)+chr(nNumber/256)