datetime value

 

Hi,

I want to write the actual data and the time

extern int starthour = 8;

extern int startminute = 0;

in my variable

datetime starttime= 0;

How can I write this?

 
sunshineh:

Hi,

I want to write the actual data and the time

extern int starthour = 8;

extern int startminute = 0;

in my variable

datetime starttime= 0;

How can I write this?

https://docs.mql4.com/basis/types/datetime

 

Thanks you, but I have seen this side, before I asked my question!

But how can I write this:

starttime = Date of the day + starthour + startminute;

 
sunshineh:

Thanks you, but I have seen this side, before I asked my question!

But how can I write this:

starttime = Date of the day + starthour + startminute;

Why don't u just use an extern of type datetime for input like so:

extern datetime starttime = D'08:00:00'
 
gordon:

Why don't u just use an extern of type datetime for input like so:

Just a note though, if u intend to CHANGE the value of this variable via code during run, then it is recommended to pass that variable to a normal global param, since on every init()/deinit() your extern param will be reset to the last value u gave it with the properties window.

Reason: