here is what I have came up with so far..
I will be working on the month function next.
any tip/pointers you can give me would also be appreciated.
thx for the replies so far everyone 😉
Today: <?php
$timestamp = time();
$date_time_array = getdate($timestamp);
$hours = $date_time_array['hours'];
$minutes = $date_time_array['minutes'];
$seconds = $date_time_array['seconds'];
$month = $date_time_array['mon'];
$day = $date_time_array['mday'];
$year = $date_time_array['year'];
$timestamp = mktime(day);
$newvar= strftime('%d',$timestamp);
echo $newvar;
?>
<BR>
Yesterday:
<?php
$yest = ($newvar -1);
if ($yest == "-2")
echo "29";
if ($yest == "-1")
echo "30";
if ($yest == "0")
echo "31";
else
if ($yest == "1")
echo "01";
else
if ($yest == "2")
echo "02";
else
if ($yest == "3")
echo "03";
else
if ($yest == "4")
echo "04";
else
if ($yest == "5")
echo "05";
else
if ($yest == "6")
echo "06";
else
if ($yest == "7")
echo "07";
else
if ($yest == "8")
echo "08";
else
if ($yest == "9")
echo "09";
else
echo $yest;
?>
<BR>
Two Days Ago:
<?php
$dayb4 = ($newvar -2);
if ($dayb4 == "-2")
echo "29";
if ($dayb4 == "-1")
echo "30";
if ($dayb4 == "0")
echo "31";
else
if ($dayb4 == "1")
echo "01";
else
if ($dayb4 == "2")
echo "02";
else
if ($dayb4 == "3")
echo "03";
else
if ($dayb4 == "4")
echo "04";
else
if ($dayb4 == "5")
echo "05";
else
if ($dayb4 == "6")
echo "06";
else
if ($dayb4 == "7")
echo "07";
else
if ($dayb4 == "8")
echo "08";
else
if ($dayb4 == "9")
echo "09";
else
echo $dayb4;
?>