time in php

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
deezin
Forum Newbie
Posts: 9
Joined: Sat May 11, 2002 3:21 pm

time in php

Post by deezin »

I run a freelance jobboard - and I am thinking of reworking the programming a bit so that upgraded members get the first shot at all projects on the site, maybe for the first 6 hours after a project is posted, only upgraded members can apply to it. The only problem is that I don't know how to go about coding this. Do I take a timestamp when the job is first posted and then 6 hours later take the job down? How do you do math with a timestamp? I know this might sound like a stupid question so if it is, could you just lead me to an article or tutorial on how to program with time? i never really had to work with time. thanks for all of your help.

rachel
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

if you store your data (including the timevalues) in a database try to let the database perform as much time calculations as possible.
e.g. take a look at mysql's time/date functions
http://www.mysql.com/doc/en/Date_and_time_functions.html
Post Reply