- //+------------------------------------------------------------------+
- //|判断是否在工作时间函数 |
- //+------------------------------------------------------------------+
- bool CheckTime()
- {
- if(!Use_Time)
- {
- return(true);
- }
- int time_local = TimeLocal();
- int start_time = StrToTime(TimeToStr(time_local, TIME_DATE) + " " + DoubleToStr(StartHour, 0) + ":" + DoubleToStr(StartMinit, 0));
- int end_time = StrToTime(TimeToStr(time_local, TIME_DATE) + " " + DoubleToStr(EndHour, 0) + ":" + DoubleToStr(EndMinit, 0));
- if(start_time < end_time)
- {
- if( time_local > start_time)
- {
- if( time_local < end_time)
- {
- return(true);
- }
- }
- }
- if(start_time > end_time)
- {
- if(time_local > start_time || time_local < end_time)
- {
- return(true);
- }
- }
- return(false);
- }
复制代码
|