Hi all
I am working on a small teaching project. What I want is to be able to do is insert the dates for assignments into the code at the beginning of the semester and have the assignment details be included on the correct days during the semester.
<?php
// time off the server, remember to account for time difference
// time(); returns a UNIX Timestamp
$current_date = time();
// first day you want the assignment displayed
// FORMAT is month/day/year, example 01/01/03 = Jan 1st 2003
$start_date = 09/21/03;
// last day you want the assignment displayed
// FORMAT is month/day/year, example 01/01/03 = Jan 1st 2003
$last_date = 09/23/03;
if ($start_date > $current_date) {
// too_soon.htm simply tells the visitor the assignment is not available yet.
include("too_soon.htm");
} elseif ($start_date < $current_date && $last_date > $current_date) {
// content.htm is the actually assignment.
include("content.htm");
} else {
// too_late.htm tells the student the assignment is closed.
include("too_late.htm");
}
?>
My problem is the conversion of $start_date and $last_date to a UNIX Timestamp for comparision in the if statement. How do you convert 09/21/03 to a UNIX Timestamp???
Any help would be greatly appreciated and Thank You in advance for your time.
Randy๐ ๐