Hi,
I'm using the following code to subtract 14 days from a date stored in a database. The problem is that I'm getting a date coming through, but it bears no relevance to the offset that I'm putting in.
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
$day = $row["annday"];
$type = $row["announcement"];
if($type == "PAYE") {
$offset = "-14 days";
$anndate = mktime(0, 0, 0, $month, $day, $year);
$tgtdate = strtotime($offset,$anndate); $tgtday = date("n", $tgtdate);
$tgtmonth = date("F", $tgtdate);
$tgtyear = date("Y", $tgtdate);
print("<p><font color=\"#FF0000\" face=\"Arial\" size=\"2\"><b>");
printf("%s %s - %s</b><br>\n", $day, $txt_month, $type);
printf("%s %s %s %s</font></p>\n", $row["announcement_detail"], $tgtday, $tgtmonth, $tgtyear);
Any ideas?
Thanks,
StuG