You have been given examples of how to do it.
The easiest way is to test whether now.hour() is greater or equal to 10 and now.hour() is less than 17. If so then display "Open window", else display "Close window". You said that you tried it and it didn't work. Please post your code.