Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display content until date reached 1

Status
Not open for further replies.

jgarite

Programmer
Feb 26, 2008
30
0
0
US
I am trying to figure out how to display content until a certain date is reached...is this even possible? If so, how? Not familiar at all with the date functions in php. What I have is some rebates I would like displayed on my website that expire March 31, 2008. I would like them to disappear after that day automatically in case I forget to pull them off the site. Any suggestions?
 
Code:
if ( (date("m") <= 3) && (date('Y') <= 2008) ) {
//display text
}

or

Code:
if (time() < strtotime('2008-04-01 00:00:00')) {
//display text
}
 
Excellent! Thanks, I'll try that out right now. Do you knwo if thats server time or the users computer time? I'm assuming server time...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top