Jatinder Kaur
Jatinder Kaur

Reputation: 397

Issue in saving date , date_entered no saving in suitecrm all modules

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

Answers (2)

Daniel Samson
Daniel Samson

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:

  1. 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();

  2. 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

  3. Run a Quick Repair and Rebuild

Upvotes: 0

Niranjan N Raju
Niranjan N Raju

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

Related Questions