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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

date format in talend

Please let me know how to i make talend understand the date format of "2/21/2005 12:09:18 PM".
It says that it is unable to parse the date.

Labels (2)
13 Replies
Anonymous
Not applicable
Author

What are you telling that date to?

for date format codes: http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html
Anonymous
Not applicable
Author

I am trying to convert the date format by using the function TalendDate.parseDate("MM/dd/yyyy hh:mm:ss",row1.START_DAY_ID ) in tmap.
But still it throughs the error Unparseable date: "2/21/2005 12:09:18 PM"
Anonymous
Not applicable
Author

1. is "2/21/2005 12:09:18 PM" coming in as a date or string value? (what type is row1.START_DAY_ID?)
2. "MM/dd/yyyy hh:mm:ss" should actually be "M/dd/yyyy hh:mm:ss" (only need 1 M and had 2 spaces between yyyy and hh)
Anonymous
Not applicable
Author

The data type of row1.START_DAY_ID is string.
I have reduced the extra space between yyyy and hh.
I get the error below when i use the function as TalendDate.parseDate("M/dd/yyyy hh:mm:ss",row1.START_DAY_ID )
Exception in component tDBOutput_1
java.sql.SQLException: Optional feature not implemented
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLBindInParameterString(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setChar(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setString(Unknown Source)
Anonymous
Not applicable
Author

interesting... that error I have no idea about.
Anonymous
Not applicable
Author

Hello,
I have a question,
Right now, I have to check whether the input string is in the format of "YYYYMMWW",(year month week)
so how can I parse this into another string?
is Talend.parseDate() helpful? if so how can I use this?
I've tried Talend.parseDate("yyyymmww",row1.weekstring).toString(), but it is not writing into the table as desired.
It has gone into the table in such format (Sun Apr 18 00:04:00 SGT 2010).
Please guide me how can I do.
Thanks.
Anonymous
Not applicable
Author

Hello,
I have a question,
Right now, I have to check whether the input string is in the format of "YYYYMMWW",(year month week)
so how can I parse this into another string?
is Talend.parseDate() helpful? if so how can I use this?
I've tried Talend.parseDate("yyyymmww",row1.weekstring).toString(), but it is not writing into the table as desired.
It has gone into the table in such format (Sun Apr 18 00:04:00 SGT 2010).
Please guide me how can I do.
Thanks.

Hi
I have replied you on 16769. I think you should use the built-in function TalendDate.isDate(String stringDate, String pattern).
Best regards
Shong
Anonymous
Not applicable
Author

Hi Shong,
Sorry my bad, I have left to write the main part,
I have to check the date format and compare it to the current date. 0683p000009MACn.png
Anonymous
Not applicable
Author

Hi Shong,
Sorry my bad, I have left to write the main part,
I have to check the date format and compare it to the current date. 0683p000009MACn.png

Ok, let's discuss your problem in your 16769.
Best regards
Shong