Talend Connect
Virtual Summit
JOIN US!
And visit the Customer
& Community Lounge.
May 27-28, wherever you are.

[resolved] Any way to specify this datetime format from schema editor ??

Highlighted
Four Stars

[resolved] Any way to specify this datetime format from schema editor ??

This is what kind of datetime format I have inside xml file:
12/3/2010 4:02:24 PM
Do I need to import this field as a string and then extract the date, or can I just specify a datetime format inside the schema editor in tFileInputXML ??
From the drop down menu (CTRL+SPACE) in date pattern column of schema editor I don't see the possibility to specify this type of format. The trouble is that days, months and hours can be either one or two numbers (no leading zeros).
Thx.

Accepted Solutions
Highlighted
Seven Stars

Re: [resolved] Any way to specify this datetime format from schema editor ??

The drop-down options for date pattern in the schema editor are just common suggestions. You can type any pattern you want built from the different date-part symbols or even use a variable.

View solution in original post


All Replies
Highlighted
Community Manager

Re: [resolved] Any way to specify this datetime format from schema editor ??

Hi
Specify the datetime format inside the schema in tFileInputXML as:
"dd/MM/yyyy hh:mm:ss aa"
or
Extract it as a string and then convert this string to Date on tMap or other component, for example:
TalendDate.parseDateLocale("dd/MM/yyyy hh:mm:ss aa", yourInputColumn,"en")
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Highlighted
Seven Stars

Re: [resolved] Any way to specify this datetime format from schema editor ??

The drop-down options for date pattern in the schema editor are just common suggestions. You can type any pattern you want built from the different date-part symbols or even use a variable.

View solution in original post

Highlighted
Four Stars

Re: [resolved] Any way to specify this datetime format from schema editor ??

It works. Thanx guys.
Highlighted
One Star

Re: [resolved] Any way to specify this datetime format from schema editor ??

Hi,
I specified the datetime format inside the schema of tFileInputdelimited as:
"MM/dd/yyyy HH:mm:ss aa" so that I can load the data "5/17/2016 12:00:00 AM" into DB2. 
But I couldn't load the exact format. 
I come across "Unparseable date" error and the date loaded into the db is "5/17/2016 12:00:00"
Can you please help to load this date format into DB2. 
Thanks in advance. Smiley Happy 

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog