Comparing UNIX Timestamps
Posted: Sun Nov 02, 2003 10:54 am
Hi there,
I am writing a site that contains articles that get posted from time to time by different authors. I need to have articles posted in the past 7 days bolded.
I have the presentation logic down - it is actually very easy. But, I am not familiar enough to with UNIX timestamps to know what the the most acurate way to compare them.
Right now, whenevr a post is made, I use the time() function to send a timestamp into the databse. It gets formateed with date() when the article is accessed. In order to compare the current date with the last date, should I be using time() again, and compare that to the stamp in the database? If so, how exactly should that comparison get played out; if not, is there a better method I should be using?
Thanks in advance. I'll be gone for a few hours, but I'll be back later on in the day to discuss this further.
{ d }
I am writing a site that contains articles that get posted from time to time by different authors. I need to have articles posted in the past 7 days bolded.
I have the presentation logic down - it is actually very easy. But, I am not familiar enough to with UNIX timestamps to know what the the most acurate way to compare them.
Right now, whenevr a post is made, I use the time() function to send a timestamp into the databse. It gets formateed with date() when the article is accessed. In order to compare the current date with the last date, should I be using time() again, and compare that to the stamp in the database? If so, how exactly should that comparison get played out; if not, is there a better method I should be using?
Thanks in advance. I'll be gone for a few hours, but I'll be back later on in the day to discuss this further.
{ d }