If the time now is a new hour then...

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

Post Reply
eon201
Forum Newbie
Posts: 10
Joined: Thu Nov 01, 2007 3:57 am

If the time now is a new hour then...

Post by eon201 »

Hi,

Im trying to think of a way to write a piece of code that basiaclly does this.

If the time now is a new hour then...
If the time now is a new day then...
if the time is a new week then...
if the time now is a new month then...

once I have that I can create mysql tables at the right time to store data.

Thanks in advance!
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

Store old times for comparison, then use strftime to get appropriate now values.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: If the time now is a new hour then...

Post by Kieran Huggins »

eon201 wrote:once I have that I can create mysql tables at the right time to store data.
er... this smells of bad design to me.

Why all the extra tables?
Post Reply