"Day of month"

 
Deleted/undeleted by moderator William Roeder  (wrong post)

hi. how can i get day of month in mql5 in integer?

I easily used :

TimeDay(Time[n])

for comparing, but in ME5 I can't find anything like this. Can someone explain it to me or show me how to write it, cause I'm not a pro coder? thanks.

 
MD KH:

hi. how can i get day of month in mql5 in integer?

I easily used :

for comparing, but in ME5 I can't find anything like this. Can someone explain it to me or show me how to write it, cause I'm not a pro coder? thanks.

hi

use this :

int dayOfMonth(datetime time){
MqlDateTime mqt;
if(TimeToStruct(time,mqt)){
return(mqt.day);  
}
return(-1);
}
 
MD KH:

hi. how can i get day of month in mql5 in integer?

I easily used :

for comparing, but in ME5 I can't find anything like this. Can someone explain it to me or show me how to write it, cause I'm not a pro coder? thanks.

Read up TimeToStruct()

First store the current time using iTime() into a variable of type datetime.

Then create an object of type MqlDateTime. It's a struct that you will use as a parameter for the function TimeToStruct()

Call TimeToStruct and Pass it the current time and your datetime structure.

From there you can call structure.day_of_week
 
MD KH:

hi. how can i get day of month in mql5 in integer?

I easily used :

for comparing, but in ME5 I can't find anything like this. Can someone explain it to me or show me how to write it, cause I'm not a pro coder? thanks.

PS, I don't think day of month is available from the TimeToStruct function

You'll have access to day, day of week, and day of year. Read the documentation to be absolutely sure, I may be wrong.

But I doubt it's available, you may need some elbow grease if you are determined to know which day of the month specifically 
 
Gamuchirai Zororo Ndawana #:
PS, I don't think day of month is available from the TimeToStruct function

You'll have access to day, day of week, and day of year. Read the documentation to be absolutely sure, I may be wrong.

But I doubt it's available, you may need some elbow grease if you are determined to know which day of the month specifically 
Tell me what is your expectations for the "day of month" and how it is different from day.