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

string to date

Hi,
I have a string like that "16/01/2008 09:04:12 AM" and i need to have a date from this string.
i try with TalendDate.parseDate("dd/MM/yyyy HH:mm:ss aa", madate) but it doesn't work.
the log is Unparseable date: "16/01/2008 09:04:12 AM"
Have u got an idea to help me ?

Labels (2)
20 Replies
_AnonymousUser
Specialist III
Specialist III

hi,
how to convert string to date in tmap
my string is "06/04/2010" but its give a error
java .lang .numberformatexception
regards,
naveen
Anonymous
Not applicable
Author

Hi,
I have a string like that "2 November 2010" and i need to have a date from this string.
Any Idea how I can convert this using Talend ?
Thanks
Z
Anonymous
Not applicable
Author

Anonymous
Not applicable
Author

I tried the same with variable type as date and expression as
TalendDate.parseDate("dd/MM/yyyy HH:mm:ss",row1.Target_Resolution_Date)

where row1.Target_Resolution_Date is of type string
in tMap component but i faced the following error
Exception in component tMap_1
java.lang.RuntimeException: java.text.ParseException: Unparseable date: "13 12 2011 06:00:00"
at routines.TalendDate.parseDate(TalendDate.java:643)
at honey.create_my_first_job_0_1.Create_My_First_Job.tFileInputExcel_3Process(Create_My_First_Job.java:1566)
at honey.create_my_first_job_0_1.Create_My_First_Job.runJobInTOS(Create_My_First_Job.java:2312)
at honey.create_my_first_job_0_1.Create_My_First_Job.main(Create_My_First_Job.java:2186)
Caused by: java.text.ParseException: Unparseable date: "13 12 2011 06:00:00"
at java.text.DateFormat.parse(DateFormat.java:354)
at routines.TalendDate.parseDate(TalendDate.java:641)
... 3 more
disconnected
Job Create_My_First_Job ended at 12:58 18/01/2012.
Anonymous
Not applicable
Author

hi i want to convert string 7/17/2012 2:57:16 PM to date but it gives error
Exception in component tMap_2
java.lang.RuntimeException: java.text.ParseException: Unparseable date: "7/17/2012 2:57:16 PM"
at routines.TalendDate.parseDateLocale(TalendDate.java:676)
at xml_to_mysql.xml_master_data_conversion_0_1.Xml_Master_Data_Conversion.tFileInputXML_4Process(Xml_Master_Data_Conversion.java:6989)
at xml_to_mysql.xml_master_data_conversion_0_1.Xml_Master_Data_Conversion.runJobInTOS(Xml_Master_Data_Conversion.java:8194)
at xml_to_mysql.xml_master_data_conversion_0_1.Xml_Master_Data_Conversion.main(Xml_Master_Data_Conversion.java:8062)
Caused by: java.text.ParseException: Unparseable date: "7/17/2012 2:57:16 PM"
at java.text.DateFormat.parse(DateFormat.java:337)
at routines.TalendDate.parseDateLocale(TalendDate.java:674)
... 3 more
disconnected
Regards,
naveen
Anonymous
Not applicable
Author

Hi
I have this problem with the convertion of a data String type to Date.
I have this value 2012-04-26T18:27:55, and i want to convert it to a Date data type
I need this format dd/mm/yyyy
This is the error message that is returnig:
java.lang.RuntimeException: java.text.ParseException: Unparseable date: "2012-04-26T18:27:55
Anonymous
Not applicable
Author

Hi
I have this problem with the convertion of a data String type to Date.
I have this value 2012-04-26T18:27:55, and i want to convert it to a Date data type
I need this format dd/mm/yyyy
This is the error message that is returnig:
java.lang.RuntimeException: java.text.ParseException: Unparseable date: "2012-04-26T18:27:55

I have the same issue. Did you solved it or can anybody else can help me to make this working?
Anonymous
Not applicable
Author

try below code which help you to parse date string into date format, note you can modify your output date format as per your requirement.
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
SimpleDateFormat output = new SimpleDateFormat("dd/MM/yyyy");
Date d = sdf.parse(time);
String formattedTime = output.format(d);
Anonymous
Not applicable
Author

Tanks for you reply umeshrakhe.
I solved it another way by setting the pattern in the tXMLMap and changing the input datatype in the Tree schema editor.
Cheers!
Anonymous
Not applicable
Author

My data is coming like this 2016-10-15 16:50:11, I want this in yyyymmdd format.How can I do this by using Tmap.
Can any one please suggest.
Appreciate for help.
Thanks its done now .