Page 1 of 1

Displaying a message for a time-frame

Posted: Mon Mar 06, 2006 5:45 pm
by neoaddict
How would I echo a message for an hour, or a minute?
I can't just use date/time, right? That would only display it for a second...?

Posted: Mon Mar 06, 2006 5:48 pm
by feyd
store the range information for when to display and not display the message.

Posted: Mon Mar 06, 2006 6:44 pm
by neoaddict
What function would I use?

Sorry, I'm just not very good at times. :(

Posted: Mon Mar 06, 2006 6:46 pm
by feyd
No function other than one of the unix timestamp creation functions to generate the timestamps needed (three in all: start, end, and now)

Posted: Tue Mar 07, 2006 4:38 pm
by neoaddict
What is the unix timestamp functions? :( :?

Posted: Tue Mar 07, 2006 4:46 pm
by feyd

Posted: Tue Mar 07, 2006 6:08 pm
by josh
Use mktime and store it into $start and $end
then use a range

Code: Select all

$show_message = time() <= $end && time() >= $start
var_dump($show_message);