5

Importing the date works correctly, but the time shown is always 12:00 am even though the import field is, for example 02/07/2018 11:31 am. I tried various formats like the previously mentioned 02/07/2018 11:31 am or 03/04/2018 14:22.

How can I import the time and the date into a CiviCRM date field. I am importing the dates into a custom date field.

3

I don't think that this is currently possible. The time part will we stripped in CRM_Utils_Date::convertToDefaultDate() called here: https://github.com/civicrm/civicrm-core/blob/master/CRM/Contact/Import/Parser/Contact.php#L1909

You could have an extension read an imported text field with a date string and set the proper datetime value for the custom field via the hook hook_civicrm_custom in an extension. But adding the functionality to core would most likely make more sense.

  • is this still the case? – Zachary Mar 26 at 3:27
  • Yes, I'm not aware of anyone attempting to make changes yet. – Thomas Schüttler Mar 27 at 7:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.