Guidance
指路人
g.yi.org
Guidance Forums / Reginald Rexx / setting system time

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. setting system time
#5933
Posted by: 2005-03-01 16:07:19
I'm looking for a more elegant way of setting system time then doing:
settime=23:23:23.45
ADDRESS 'cmd'
'time' settime
Is there a built in function in reginald that can handle this?
Message2. Re: setting system time
#5934
Posted by: Jeff Glatt 2005-03-01 16:57:59
There's not a built-in function, but the Windows OS has a function that you can FUNCDEF:
OPTIONS "C_CALL"
systemtime = "32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u"
FUNCDEF("SetSystemTime", "32, struct SYSTEMTIME", "kernel32")
FUNCDEF("GetSystemTime", ", struct SYSTEMTIME stor", "kernel32")

/*
SystemTime.1 is the current year.
SystemTime.2 is the current month, where January = 1, February = 2, and so on. 
SystemTime.3 is the current day of the week, where Sunday = 0, Monday = 1, and so on. This is ignored by SetSystemTime, but will be set by GetSystemTime.
SystemTime.4 is the current day of the month.
SystemTime.5 is the current hour (of a 24 hour clock).
SystemTime.6 is the current minute.
SystemTime.7 is the current second.
SystemTime.8 is the current millisecond.
*/

getsystemtime(systemtime)

/* Change fields as you see fit, for example, maybe the hour and minute */

systemtime.5 = 0
systemtime.6 = 0

/* Set the new time */
setsystemtime(systemtime)
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
¥860.00 ·
 
 
¥900.00 ·
 
 
¥810.00 ·
 
 
¥317.00 ·
 
 
¥1,370.00 ·
 
 
¥660.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0