EA programming tutorials of the date, time function
read:2023/2/24 18:47:25

A set of functions that represent the forex trading accounts type data (from cashback forex forextradingaccountsregister, 1970 midnight in seconds) Day DayOfWeek DayOfYear Hour nbsp; Minute Month Seconds TimeCurrent TimeDay TimeDayOfWeek TimeDayOfWeek nbsp;TimeDayOfYear TimeHour TimeLocal TimeMinute TimeMonth TimeSeconds ; TimeYear Year intDay() returns the day of the month, the last time the server was accessed Note: In the test, the time format for the last set of server mode Example: if(Day()<5)return(0); nbsp; intDayOfWeek() returns the forextradingaccountstype of weeks this week, (0-Sunday,1,2,3,4,5,6 and so on) from the last known time on the serverNote: In the test, the time format for the last set server mode Example: // Holidays do not work if(DayOfWeek()==0||DayOfWeek()==6)return(0); intDayOfYear() returns the day of the year (1 represents January 1... nbsp;if(DayOfYear()==245) return(true); intDayOfYear() returns the day of the year (1 for January 1...,365(6) is December 31), the last time the server was accessed. nbsp; intHour() a few moments before the program starts, return the number of hours (0,1,2,. .23) the last accessed server time (this value does not change during the period within the execution of the program) Note: In the test, the time format for the last set server mode Example: bolis_siesta=false; if(Hour()>=12||Hour()<17) nbsp; is_siesta=true; intMinute() returns the current minute (0,1,2,. .59) last accessed server time (this value does not change during the execution of the program) Example: if(Minute()<=15) return(firstquarter); intMonth() a few moments before the program starts, returns the current number of months (1,2,. .12) the last accessed server time (this value does not change during the execution of the program) Note: In the test, the time format for the last set of server mode Example: if(Month()<=5) return(thefirsthalfyear);& nbsp; intSeconds() a few moments before the start of the program, return the current number of seconds as the number last accessed server time (this value does not change during the execution of the program) Example: if(Seconds()<=15) return(0); datetimeTimeCurrent() return to the last accessed server time (the latest quote input time) as seconds digital from 00:001970 January 1 Note: in the test, the time format for the last set server mode example: if( TimeCurrent()-OrderOpenTime()<360)return(0); intTimeDay(datetimedate) returns the date of the input date (1-31) parameter:date - as the number of seconds from 00:00 January 1, 1970 example: intday=TimeDay(D2003.12.31); //day is 31 intTimeDayOfWeek(datetimedate) returns the first few days of the week starting from zero (0 for Sunday,1,2,3,4,5,6) for the specified date parameter:date - as the number of seconds from 00:00 January 1, 1970 Example: intweekday=TimeDayOfWeek(D2004.11.2); //number2-Tuesday intTimeDayOfYear(datetimedate) returns the number of days in a year the number of days in the (1 means January 1... ,365(6) means December 31) for the specified date parameter:date - as the number of seconds from 00:001970 January 1 example: intday=TimeDayOfYear(TimeCurrent()); intTimeHour(datetimetime) returns the hour as the specified time parameter:time - as the number of seconds from 00:00 January 1, 1970 Example: inth=TimeHour( TimeCurrent()); datetimeTimeLocal() returns the current computer time, starting from 00:001970 January 1 Note: In the test, the time format is the last set server mode Example: if (TimeLocal()-OrderOpenTime()<360)return(0); intTimeMinute(datetimetime)return minutes for the specified time parameter:time -& nbsp;as the number of seconds from 00:00 January 1, 1970 Example: intm=TimeMinute(TimeCurrent()); intTimeMonth( datetimetime) returns the number of months for the specified time parameter:time - as the number of seconds from 00:00 January 1, 1970 Example: intm=TimeMonth(TimeCurrent()); ; intTimeSeconds(datetimetime) returns the number of seconds for the specified time parameter:time - as the number of seconds, starting at 00:00 January 1, 1970 Example: intm= TimeSeconds(TimeCurrent()); intTimeYear(datetimetime) returns the number of years for the specified time return value range can be between 1970 and 2037 parametric:time -& nbsp;as the number of seconds from 00:00 January 1, 1970 example: inty=TimeYear(TimeCurrent()); intYear() returns the number of years in the current year, that is, the number of years the server time notes: In the test, the time format for the last set server mode example: //If the time range between January and April 30, 2006, return if(Year()==2006&&Month()<5) return(0);