Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to Concatenate a date and a time field in Talend

Hello,
I am working with a file delimited CSV and I am trying to concatenate the Date and the time fields together. I have them set for a date string.
Date format = MM-DD-YYYY
time format = HH:mm 0683p000009M9p6.pngS
Examples of data is:
Time Date
8:08 1/10/2013
14:03 1/10/2013


When I do a readfile1.date + readfile1.time it gives me the following error:
The operator + is undefined for the argument type(s) java.util.Date, java.util.Date
I need these in a specific date format of YYYY-MM-DD HH:mm 0683p000009M9p6.pngS
I do apologize for even having to ask this. I have scoured the forums for this answer and everything that has been answered has not worked.
Thanks in advance,
Labels (3)
1 Reply
Anonymous
Not applicable
Author

you are close 0683p000009MACn.png
you will simply need to convert your Date's to strings before you concat. Talend comes with some methods to do this:
routines.TalendDate.formatDate(pattern, date)

so your code would look something like this:
routines.TalendDate.formatDate("yyyy-MM-dd",readfile1.date) + " " + routines.TalendDate.formatDate("HH:mm:SS",readfile1.time)

edit: figured you might want a space between date and time