When importing from plain txt source (tabdelimited, etc..) you have to match format as it is written inside the file you're about to import into job.
In schema editor, define the appropriate field as Date and double click on the date DatePattern and write down your format or just use CTRL+SPACE for suggestions.
For example, if your starting .csv file has date in numeric format: 17032011, you would write in DatePattern field in schema editor: "ddMMyyyy".
Once inside talend, you can just use the default format "dd-mm-yyyy". At the end of the flow:
1. If you're dumping data into say tabdelimited file, you can choose again the Date Pattern
2. if you're dumping the data into some database, there's no option to specify the date format. Database will use it's own.
I need to be able to change the default automatically generated date pattern so when I generate a table schema for a database I want the pattern as yyyy-MM-dd not dd-MM-yyyy. I don't want to have to change anything in the schema as there are dozens of date fields in the database.
I was hoping there would be something to change in the Talend preferences.
What DB are you using? As vladika said, generally for a DB, a date is a date is a date. It does not have a format as such. The way dates are displayed by the DB is native to the DB and cannot usually be set at the field/table level. So, when writing a Date to a DB, it does not matter what the Date Pattern is in Talend. The Talend Date Pattern is only relevant when reading from/writing to flat-files.
We really need this option as well.
I don't see why the mapping.xml file cannot have an attribute for default date pattern just like the other fields (length, precision, etc).
if you have a job that requires hundreds of patterns to be declared, it literally makes the product unusable. You want to waste hours of an engineers time changing a text box when the UI could just default the value from your xml config.
I agree that it is an interesting and useful feature, our R&D team have known it.
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!