Working with Dates

From: Date: Thu, 02 Dec 2004 21:19:32 +0000
Subject: Working with Dates
Groups: php.general 
Request: Send a blank email to php-general+get-203386@lists.php.net to get a copy of this message
I have this code below that needs to display stuff depending on WHEN it is. I am pretty sure it is something simple I have confused (again) but can't place my finger on it. Anyone see the mistake? <?php $today = date("m-d-y"); $early = date("m-d-y",mktime(0, 0, 0, 1, 14, 2005)); $normal = date("m-d-y",mktime(0, 0, 0, 1, 31, 2005)); if ($today <= $early) //also done with writing in "01-14-05" { print "<tr><td>Pre-Conference</td><td>$12</td><td><input name=\"Pre-Conference\" type=\"radio\" value=\"Y\"></td></tr>"; print "<tr><td>Early Registration (thru 01-14-05)</td><td>$85<input name=\"Conference\" type=\"radio\" value=\"Early Registration\"></td></tr>"; print "<tr><td>Registration for Saturday Only (thru 01-14-05)</td><td>$65</td><td><input name=\"Conference\" type=\"radio\" value=\"Early Saturday Only\"></td></tr>"; } else if ($today >= "01-15-05" || $today <= "01-31-05") { print "<tr><td>Registration (01-15-05 thru 01-31-05)</td><td>$95</td><td><input name=\"Conference\" type=\"radio\" value=\"Registration\"></td></tr>"; print "<tr><td>Registration for Saturday Only (01-15-05 thru 01-31-05)</td><td>$70</td><td><input name=\"Conference\" type=\"radio\" value=\"Saturday Only\"></td></tr>"; } ?> Thanks, Robert -- Robert Sossomon, Business and Technology Application Technician 4-H Youth Development Department 200 Ricks Hall, Campus Box 7606 N.C. State University Raleigh NC 27695-7606 Phone: 919/515-8474 Fax: 919/515-7812 robert_sossomon@ncsu.edu

« previous php.general (#203386) next »