wkempees
|
| Posted: 02/28/2006, 12:58 PM |
|
instead off getdate use date()
$claims->tickler_date->SetValue( date("m/d/Y") );
Check the project and database setting for you date fields, as suggested
earlier.
Also post here the type and settings of the field tickler
The following piece of code will give you 15 days ahead of today's date:
echo date('d/m/Y'); // display today's date in dd/mm/yyyy
$year = substr(date('Y/m/d'), 0, 4); // notice the different format
$month = substr(date('Y/m/d'), 5, 2);
$day = substr(date('Y/m/d'), 8, 2);
$t1 = mktime(0, 0, 0, $month, $day, $year); // builds a timestamp.
echo $t1 .' '; // just to show you what a time stamp looks like
echo Date("d-m-Y",$t1). '<br>'; // prove it is stil okay,
$t1 = mktime( date('h', $t1), // add 15 to the 'd' day
parameter
date('i', $t1), // this will cater for month's
and year's end
date('s', $t1), //
date('m', $t1),
date('d', $t1) + 15,
date('Y', $t1)
);
echo $t1 .'<br>'; // show the new timestamp, not
that it's any use (no of seconds since ...)
echo Date("d-m-Y",$t1); // show the date 15 days from
NOW
Of course you have to cater for the correct date formats, without messing up
the calculation bit.
BTW Getdate() returns an array where your field expects a string.
Your coee would have to be something like:
$year = substr(date('Y/m/d'), 0, 4); // notice the different format
$month = substr(date('Y/m/d'), 5, 2);
$day = substr(date('Y/m/d'), 8, 2);
$t1 = mktime(0, 0, 0, $month, $day, $year); // builds a timestamp.
$t1 = mktime( date('h', $t1), // add 15 to the 'd' day
parameter
date('i', $t1), // this will cater for month's
and year's end
date('s', $t1), //
date('m', $t1),
date('d', $t1) + 15,
date('Y', $t1)
);
$claims->tickler_date->SetValue( date("m/d/Y",$t1) );
|