Share this page 

Set the system date/timeTag(s): Powerscript WinAPI/Registry


[structure definition , str_systemtime]
year     uint
month    uint
dayweek  uint
day      uint
hour     uint
min      uint
sec      uint
millsec  uint

[local external function declaration]
FUNCTION long SetLocalTime(ref str_systemtime lpSystemTime ) &
  LIBRARY "kernel32.dll"

[clicked event of a button]
str_systemtime lstr_systemtime


lstr_systemtime.year     = 1999
lstr_systemtime.month    = 1     // January = 1 and so on.
lstr_systemtime.dayweek  = 0     // not used
lstr_systemtime.day      = 3     
lstr_systemtime.hour     = 12     
lstr_systemtime.min      = 0 
lstr_systemtime.sec      = 0    
lstr_systemtime.millsec  = 0

SetLocalTime(lstr_systemtime)