Setting a page to expire

Good day.

I have spent days searching the web for a solution, but only find options that are close to what I need, but not close enough.

I have a web page that I need to expire on a specific date. A user will access the site freely until the specified date is reached. From the specified date onward, the page needs to display a message instead of the page content.

Can anyone assist me with the correct scrip?

Thank you.

I have moved your question into its own topic because it did not relate to the original topic that you posted it in.