-
Is This Possible?
I want to include a php date function on a webpage however, i actually want to include say 3 or 4 individual date functions...
What i want, lets say you are looking at the page today the date functions would show this...
04-16-07 - Link One
04-14-07 - Link Two
04-12-07 - Link Three
Now, if you looked at the page tomorrow, the date functions would show this...
04-17-07 - Link One
04-15-07 - Link Two
04-13-07 - Link Three
Basically, its the date function but it goes back 2,4 and 6 days when the date is displayed.
Does that make sense? If so, how would i go about doing it, is it even possible?
Regards,
Lee
-
I'm not a PHP programmer, but that should be mad simple.
Dates in Linux are stored as a numeric value equal to the number of seconds since 1/1/1970. 24 hours = 86400 seconds. So all you should need to do is set each of your date values equal to those values, something similar to
linkonedate = (today's date)
linktwodate = (today's date) - (2*86400)
linkthreedate = (today's date) - (4*86400)
and then use whatver the PHP function to display a date is, such that date = linkthreedate or whatever.
-
Is this what you want to do?
Code:
$today = mktime();
$tomorrow = mktime(0, 0, 0, date("m") , date("d")+1, date("Y"));
$dayaftertomorrow = mktime(0, 0, 0, date("m") , date("d")+2, date("Y"));
echo date('m-d-y', $tomorrow );
?>
for date formatting see http://www.php.net/manual/en/function.date.php
:develish: