PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
neoaddict
Forum Commoner
Posts: 44 Joined: Thu Jan 12, 2006 12:28 pm
Post
by neoaddict » Mon Mar 06, 2006 5:45 pm
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...?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Mar 06, 2006 5:48 pm
store the range information for when to display and not display the message.
neoaddict
Forum Commoner
Posts: 44 Joined: Thu Jan 12, 2006 12:28 pm
Post
by neoaddict » Mon Mar 06, 2006 6:44 pm
What function would I use?
Sorry, I'm just not very good at times.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Mar 06, 2006 6:46 pm
No function other than one of the unix timestamp creation functions to generate the timestamps needed (three in all: start, end, and now)
neoaddict
Forum Commoner
Posts: 44 Joined: Thu Jan 12, 2006 12:28 pm
Post
by neoaddict » Tue Mar 07, 2006 4:38 pm
What is the unix timestamp functions?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Mar 07, 2006 4:46 pm
josh
DevNet Master
Posts: 4872 Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida
Post
by josh » Tue Mar 07, 2006 6:08 pm
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);