ckroon
Posts: 868
|
Posted: 05/23/2008, 11:23 PM |
|
Hi all. Struggling with this code.
I have three dates in hidden fields on a grid. I need to set the label 'start_date' to the largest of the three dates.
Here is what I have:
$Container->enr_date->SetValue(( strtotime(CCFormatDate($Container->enr_date->GetValue(),array("yyyy", "-",
"mm", "-", "dd"))) ) / 86400);
$Container->term_date->SetValue(( strtotime(CCFormatDate($Container->term_date->GetValue(),array("yyyy", "-",
"mm", "-", "dd"))) ) / 86400);
$Container->mydate->SetValue(( strtotime(CCFormatDate($Container->mydate->GetValue(),array("yyyy", "-",
"mm", "-", "dd"))) ) / 86400);
$final_date= max( array($Container->enr_date->Getvalue() , $Container->term_date->GetValue(), $Container->mydate->GetValue()) );
$Container->start_date->Setvalue($final_date);
I get an error (testing on local machine): Notice: strtotime(): Called with empty time parameter in c:\inetpub\wwwroot\cavatesttest\teacher\print_fall_init_isma2_events.php on lines 22,24,26
The start_date is being set to: 1969-12-31
When I echo the results I see a string like this: 14022.2916667
When I display the hidden fields as lavbels, they display fine.
All labels are set to Date, format yyyy-mm-dd
Using Mysql 4.0
I assume I am formatting the date strings incorrectly... but other than that I am lost.
Thanks!
_________________
Walter Kempees...you are dearly missed. |