Date&TimefunctionsCurTime()Day()DayOfWeek()DayOfYear()Hour()LocalTime()Minute()Month()Seconds()TimeDay()TimeDayOfWeek()TimeDayOfYear()TimeHour()TimeMinute()TimeMonth()TimeSeconds()TimeYear()Year()datetimeCurTime()Returnslastknownserver'stime,numberofsecondselapsedfrom00:00January1,1970.Sampleif(CurTime()-OrderOpenTime()360)return(0);intDay()Returnscurrentdate'sdayofmonth.Sampleif(Day()5)return(0);intDayOfWeek()Returnscurrentdate'szerobaseddayofweek(0-Sunday,1,2,3,4,5,6).Sample//donotworkonholidays.if(DayOfWeek()==0||DayOfWeek()==6)return(0);intDayOfYear()Returnscurrentdate'sdayofyear(1-1january,..,365(6)-31december).Sampleif(DayOfYear()==245)return(true);intHour()Returnscurrenthour(0,1,2,..23)Sampleboolis_siesta=false;if(Hour()=12||Hour()17)is_siesta=true;datetimeLocalTime()Returnslocalcomputertime,numberofsecondselapsedfrom00:00January1,1970.Sampleif(ServerTime()-OrderOpenTime()360)return(0);intMinute()Returnscurrentminute(0,1,2,..59).Sampleif(Minute()=15)return(firstquarter);intMonth()Returnscurrentmonthasnumber(1-January,2,3,4,5,6,7,8,9,10,11,12).Sampleif(Month()=5)return(firsthalfofyear);intSeconds()Returnscurrentsecond(0,1,2,..59).Sampleif(Seconds()=15)return(0);intTimeDay(datetimedate)Returnsdayofmonth(1-31)forspecifieddate.Parametersdate-Datetimeisnumberofsecondselapsedsincemidnight(00:00:00),January1,1970.Sampleintday=TimeDay(D'2003.12.31');//dayis31intTimeDayOfWeek(datetimedate)Returnszerobaseddayofweek(0-Sunday,1,2,3,4,5,6)forspecifieddate.Parametersdate-Datetimeisnumberofsecondselapsedsincemidnight(00:00:00),January1,1970.Sampleintweekday=TimeDayOfWeek(D'2004.11.2');//dayis1-tuesdayintTimeDayOfYear(voiddate)Returnsday(1-1january,..,365(6)-31december)ofyearforspecifieddate.Parametersdate-Datetimeisnumberofsecondselapsedsincemidnight(00:00:00),January1,1970.Sampleintday=TimeDayOfYear(CurTime());intTimeHour(datetimetime)Returnshourforspecifiedtime.Parameterstime-Datetimeisnumberofsecondselapsedsincemidnight(00:00:00),January1,1970.Sampleinth=TimeHour(CurTime());intTimeMinute(datetimetime)Returnsminuteforspecifiedtime.Parameterstime-Datetimeisnumberofsecondselapsedsincemidnight(00:00:00),January1,1970.Sampleintm=TimeMinute(CurTime());intTimeMonth(datetimetime)Returnsmonthforspecifiedtime.Parameterstime-Datetimeisnumberofsecondselapsedsincemidnight(00:00:00),January1,1970.Sampleintm=TimeMonth(CurTime());intTimeSeconds(datetimetime)Returnssecondsforspecifiedtime.Parameterstime-Datetimeisnumberofsecondselapsedsincemidnight(00:00:00),January1,1970.Sampleintm=TimeSeconds(CurTime());intTimeYear(datetimetime)Returnsyearforspecifieddate.Returnvaluescanbeinrange1970-2037.Parameterstime-Datetimeisnumberofsecondselapsedsincemidnight(00:00:00),January1,1970.Sampleinty=TimeYear(CurTime());intYear()Returnscurrentyear.Sample//returnifdatebefore1May2002if(Year()==2002&&Month()5)return(0);日期时间函数[Date&TimeFunctions]datetimeCurTime()返回当前时间示例:if(CurTime()-OrderOpenTime()360)return(0);intDay()返回当前日期示例:if(Day()5)return(0);intDayOfWeek()返回当前日期是星期几0-星期天,1,2,3,4,5,6示例://donotworkonholidays.if(DayOfWeek()==0||DayOfWeek()==6)return(0);intDayOfYear()返回当前日期在年内的第几天示例:if(DayOfYear()==245)return(true);intHour()返回当前的小时数0-23示例:boolis_siesta=false;if(Hour()=12||Hour()17)is_siesta=true;datetimeLocalTime()返回当前电脑时间示例:if(LocalTime()-OrderOpenTime()360)return(0);intMinute()返回当前分钟示例:if(Minute()=15)return(firstquarter);intMonth()返回当前月份示例:if(Month()=5)return(firsthalfofyear);intSeconds()返回当前秒数示例:if(Seconds()=15)return(0);intTimeDay(datetimedate)返回输入日期中的日期::输入参数date-输入日期示例:intday=TimeDay(D'2003.12.31');//dayis31intTimeDayOfWeek(datetimedate)返回输入日期中的日期是星期几(0-6)::输入参数date-输入日期示例:intweekday=TimeDayOfWeek(D'2004.11.2');//dayis2-tuesdayintTimeDayOfYear(datetimedate)返回输入日期中的日期在当年中的第几天::输入参数date-输入日期示例:intday=TimeDayOfYear(CurTime());intTimeHour(datetimetime)返回输入日期中的小时::输入参数date-输入日期示例:inth=TimeHour(CurTime());intTimeMinute(datetimetime)返回输入日期中的分钟::输入参数date-输入日期示例:intm=TimeMinute(CurTime());intTimeMonth(datetimetime)返回输入日期中的月份::输入参数date-输入日期示例:intm=TimeMonth(CurTime());intTimeSeconds(datetimetime)返回输入日期中的秒钟::输入参数date-输入日期示例:intm=TimeSeconds(CurTime());intTimeYear(datetimetime)返回输入日期中的年份::输入参数date-输入日期示例:inty=TimeYear(CurTime());intTimeYear(datetimetime)返回当前年份示例://returnifdatebefore1May2002if(Year()==2002&&Month()5)return(0);