Jump to content

Trying to figure this out. O.o


selfproduction

Recommended Posts

I'm trying to write a simple script that will display a message to guests between a certain time range, for example, 11 am to 12 pm.

 

This is what I have so far, as I want it set into PST. I thought I'd be able to use an if/else to compare the times. But I'm not finding a way for it the $msgtimes to equal a time range. I may be going about this completely wrong, if someone could please point me in the right direction?

 

<?
$time_offset ="-3"; 
$adj = ($time_offset * 3600);
$current = date("h:i", time() + $adj);

$msgtimes = ; 

if ($current==$msgtime) { 
echo("message"); 
} else {
echo("$current");
}
?>

Link to comment
https://forums.phpfreaks.com/topic/41741-trying-to-figure-this-out-oo/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.