Something about getLocalTime or getRealTime. Look at chatlog mod it has functions that record the time of day. Once you have that you need a schedule loop that checks the time of day. It's basically a function that is scheduled to call itself every couple of seconds like:
function checktimeLoop() {
CheckTime();
$checktimeloop = schedule(30000,0,checktimeLoop);
}
And your CheckTime function should check the time and if it's between a certain time sets $pref::server::password to whatever