Here's a little script, I wrote...
I think it might be called an autoexpire function?
What it does is display 'yet to come' until it gets to a set time, then it displays 'this is it' for a set time, then it displays 'been and gone'.
I'll be using it to automatically display a time-limited special offer on a set date.
As a test script, I've set the time in seconds so I didn't have to wait too long to test the changeovers.
My question is this: does this script read the local time from my computer's clock or does it get it from the server? It's not much use if it's from a client's computer cos it may be set wrong and the special offer will appear at the wrong time!
I once checked a script by changing the clock on my computer and it screwed up my antivirus and other programmes, so I'm very reluctant to do that again!
<?php
$now = date("d M h i s");
if ($now < ("03 May 12 28 00"))
{echo "yet to come";}
elseif
($now <= ("03 May 12 28 05"))
{echo "this is it";}
elseif
($now > ("03 May 12 28 05"))
{echo "been and gone";}
?>