Can I set a timer for pages to be published?

No script of function necessary. It’s actually built into WordPress. Simply go to your page to edit and on the right hand side you should see a widget labeled Publish.

On the third line down, you will see an Edit button and you can set the date and time on when you want the page to be shown:

Publish