Reputation: 397
I have issue in date_entered. It saves NULL instead of saving current date time stamp.
This issue is happening in all modules.
Upvotes: 0
Views: 2138
Reputation: 718
You can also use the timedate global variable like this:
global $timedate;
$bean->date_entered = $timedate->nowDb();
Here are some common troubleshooting steps:
Make sure that you are correctly handling the bean for the record you wish to create:
$bean = BeanFactory::newBean("ModuleName");
$bean->name = 'some value';
$bean->property_name = 'some value';
$bean->save();
Ensure the file and folder permissions are correctly set for your instance. On an Ubuntu system you can run:
sudo cd /path/to/suitecrm | sudo chown www-data:www-data . -R && sudo chmod 775 . -R
Run a Quick Repair and Rebuild
Upvotes: 0
Reputation: 11987
Default format of mysql date is YYYY-MM-DD
.
If your column type is date or datetime, you have to store in YYYY-MM-DD
format only.
If you wish to change date while storing to database,
$date = "date in any format";
date("Y-m-d",strtotime($date));
And if you wish to change format of date while displaying, see formats here
Upvotes: 1