Results 1 to 2 of 2
Thread: Date math problem - getdate()
Nov 29, 2004, 09:38 #1
- Join Date
- Nov 2004
- 0 Post(s)
- 0 Thread(s)
Date math problem - getdate()
I've got a problem that's almost certainly simple to fix, but I can't seem to see the solution. What I'm trying to do is subtract 2 months from the system date and I can't seem to get it to work. Here's the code I've got:
$today = getdate();
$unixdate = $today;
$delete_date = $unixdate - (60 * 60 * 24 * 60); // subtract 60 days (in seconds)
$delete_month = $delete_date['mon'];
echo"Delete_month = $delete_month<br>";
When this runs, the variable $delete_month doesn't have a value stored in it.
I'd apprecaite any help on this. Thanks all!