>Does anyone know how to use these, I need to be able to set system time through an VFP application .
Hi Joel,
This is the code I wrote to use the SetLocalTime - sorry about the formatting - I'm not a HTML user!
FUNCTION SetDateTime
PARAMETERS tlDateTime
LOCAL lcSetValue, lnStatus
*-- Use the Win API function
*-- When used on NT an extra Privilege has to be set!!
DECLARE INTEGER SetLocalTime IN win32api STRING @
*-- Build up a structure for the date time
*-- Year, Month, Day Of Week (Monday = 1), Day, Hour, Minute - ignore second and millisecond
lcSetValue = CHR( MOD( YEAR( tlDateTime), 256)) + CHR( INT( YEAR( tlDateTime) / 256)) + ;
CHR( MONTH( tlDateTime)) + CHR( 0) + ;
CHR( DOW( tlDateTime, 2)) + CHR( 0) + ;
CHR( DAY( tlDateTime)) + CHR( 0) + ;
CHR( HOUR( tlDateTime)) + CHR( 0) + ;
CHR( MINUTE( tlDateTime)) + CHR( 0) + ;
CHR( VAL( RIGHT( TTOC( tlDateTime), 2))) + CHR( 0) + ;
CHR( 0) + CHR( 0) + CHR(0)
lnStatus = SetLocalTime( lcSetValue)
IF lnStatus = 0
lnStatus = _ValidError
DebugMsg( 'Problem setting the time')
ELSE
lnStatus = 0
ENDIF
RETURN lnStatus
HTH
regards
Ian