|
樓主 |
發表於 16-8-11 06:06
|
顯示全部樓層
我改成這樣子,顯示數值都對;可還是一樣,第一天都正常,隔天就不能執行了。
#property strict
int hh;
int mmm;
int ss;
int start()
{
UserTime(); //判斷時間內執行程式
}
void UserTime()
{
int starthh=8; //開始小時
int stophh=22; //結束小時
UserTimeTemp=TimeCurrent();
hh=TimeHour(TimeCurrent()); //伺服器時間 小時
mmm=TimeMinute(TimeCurrent()); //伺服器時間 分鐘
ss=TimeSeconds(TimeCurrent()); //伺服器時間 秒鐘
//Comment (UserTimeTemp+" "+hh+":"+mmm+":"+ss);
//Sleep (1000);
if (hh>starthh && hh<stophh)
{
程式執行
}
} |
|