I found a lot of related issues and scraps of solutions, mostly for D6
But they were overly complex or required the data to be modified.
I did not succeed in getting the dd/mm/yyyy correctly imported using regular feeds, tamper and php tamper.
It did not work or gave wrong order or even an unregular time translation.

The solution that did work was using hook feeds_after_parse.
This example can easily be modified for other data syntaxes or order or feeds
The custom module could get an settings page to fill in the settings that are now hard coded.

I hope it helps some other wandering souls.

/*
 * Implementation of hook_feeds_after_parse().
 * http://www.mikestiv.com/blog/using-feeds-api * 
 * processes dates of dd/mm/yyyy
*/
function ls_feeds_date_feeds_after_parse(FeedsSource $source,FeedsParserResult $result) {
  
  //dvm($source->id);
  //the id of the importer configuration
  if ($source->id == 'import_language_tests_csv_not_yet_translated_1field_csv') {
    //the fields of the import that need to be handeld by this snipet
	$array_date_fields=array('datum','uiterste datum in uct','uiterste datum via website');
	watchdog('LS_feeds_date', 'Date fields manipulated by LS_feeds_date on import, table names need to be added to add other dat fields');
    foreach ($result->items as $key => &$item) {
//	  	dvm($item); 
		  for($i=0;$i < count($array_date_fields); $i++){  		  	  	
			$your_import_date = explode('/', $item[$array_date_fields[$i]]);
//			dvm($your_import_date);		
			$your_import_date_formated = $your_import_date[1] . '/' . $your_import_date[0] . '-' . $your_import_date[2];
			$item[$array_date_fields[$i]] = strtotime($your_import_date_formated);
		  }
//		dvm($item);      
    }     
  } 

Comments

ikeigenwijs’s picture

Issue summary: View changes