1. stratacorps
  2. RO CSVI
  3. Wednesday, 17 January 2018
  4.  Subscribe via email
I have tried using rules to change the source CSV field format for a date column of "mm/dd/yyyy" to import into a database date field. The mysql custom table has the column set to date which shows up as 0000-00-00 during the import.

The import text file has it format like 01/16/2018 ... I can't find a rule combination that will import a valid mysql date.

Is the rules function the correct area to be working on this?
Accepted Answer Pending Moderation
Hello,
I have tried using rules to change the source CSV field format for a date column of "mm/dd/yyyy" to import into a database date field. The mysql custom table has the column set to date which shows up as 0000-00-00 during the import.

Yes, the default format for MySQL date field is YYYY-mm-dd so you need convert to this format before importing to database.

The import text file has it format like 01/16/2018 ... I can't find a rule combination that will import a valid mysql date.

There is no rule in CSVI yet to validate date format on import. The date format in Multi replace rule plugin is not for validating format but to import or export current date.

Is the rules function the correct area to be working on this?

You can write your own rule plugin to get this functionality. Please check Write a rule plugin document to get more details.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 1
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!