How can I get the hour integer of datetime variable?

 

I have the following datetime variable:


datetime candleTime1 = iTime(_Symbol,timeframes[i],j);             

and would want to get the hour integer for the candle in a way similar to what is done with MqlDateTime like this:

MqlDateTime rightNow;
TimeCurrent(rightNow);
Print("Hour =",rightNow.hour);

How can I get the hour integer for the "candleTime1" variable above?

 
BluePipsOnly:

I have the following datetime variable:


and would want to get the hour integer for the candle in a way similar to what is done with MqlDateTime like this:

How can I get the hour integer for the "candleTime1" variable above?

TimeToStruct(TimeCurrent(),rightNow);

//--- rightNow.hour
 
Sardion Maranatha:

I want to find the hour integer value of " candleTime1" not "rightNow".

 
BluePipsOnly:

I want to find the hour integer value of " candleTime1" not "rightNow".

Replace timecurrent with candle time
 
Sardion Maranatha:
Replace timecurrent with candle time

Thank you. It's working.

Reason: