Hello,
my database table contain a date in integer to store a timestamp.
When , in my form i write this in my form :
<?php echo $form-
>input('date',array('type'=>'date','label'=>false,'dateFormat'=>'DMY'));?
>
i can get the data like this to store them in my date column:
$m = (integer) $this->data['Calendar']['date']['month'];
$d = (integer) $this->data['Calendar']['date']['day'];
$y = (integer) $this->data['Calendar']['date']['year'];
if ( !checkdate ($m,$d,$y) ) {
$common_warning = __('the date is not a valid',true);
}
else
$this->data['Calendar']['date'] = mktime(0,0,0,$this->data['Calendar']
['date']['month'],
$this->data['Calendar']['date']['day'],
$this->data['Calendar']['date']['year']);
My problem is : when i edit the data from my form,
instead of displaying 08 june 2008
i read :1 january 2028 !
this is the fault of the strtotime function used in the function year
of the form helper...
My Question is : how can i give the Cake the correct format of my date
before displaying the edit form .?
i have tried $this->data['Calendar']['date'] = date("Y-m-d",$this-
>data['Calendar']['date']) ;
but that does not do the trick.
Regards.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---