[resolved] HELP - GET SUBSTRING OF DATE

Five Stars

[resolved] HELP - GET SUBSTRING OF DATE

Dear all,

I have a date format which look like that:  2015-10-25T00:00:00+02:00
May somebody tell me how get only 2015-10-25 in my XMLMap
I precise in tXMLMap, because i get this date format with component tXMLMap
And i try to put string type, but i get Unparseable date error

Thanks,


Accepted Solutions
Seventeen Stars

Re: [resolved] HELP - GET SUBSTRING OF DATE

hi IDEMBELE,
you say that you've got a date format & try to put String type.
could not read this data directly as a String ? When you manage data in Talend, use Date type only when you need java methods about Date.
otherwize only use String.
And use String method like substring Smiley Wink

hope it help
regards
laurent

View solution in original post


All Replies
Five Stars

Re: [resolved] HELP - GET SUBSTRING OF DATE

Dear all,
I tried to parse it by doing :
TalendDate.formatDate("yyyy-MM-dd'T'HH:mm:ss Z",2015-10-25T00:00:00+02:00  )
or
TalendDate.formatDate("yyyy-MM-dd'T'HH:mm:ss Z",2015-10-25T00:00:00+02:00 )

But it does not work, help me please
Seventeen Stars

Re: [resolved] HELP - GET SUBSTRING OF DATE

hi IDEMBELE,
you say that you've got a date format & try to put String type.
could not read this data directly as a String ? When you manage data in Talend, use Date type only when you need java methods about Date.
otherwize only use String.
And use String method like substring Smiley Wink

hope it help
regards
laurent

View solution in original post

Five Stars

Re: [resolved] HELP - GET SUBSTRING OF DATE

Hi kzone,
No it is not possible to read it as a string, i have already tried it.
And i get error, so i am obliged to format it first in string and get sub-string
Thanks,
Five Stars

Re: [resolved] HELP - GET SUBSTRING OF DATE

Hi kzone,
You are right, it is ok to set string format.
Thank you

2019 GARNER 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

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch 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