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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] parseDate and "MMM" pattern

Hello all,
I found on Forum how to parse a date like "Jun 30 12 12:16:45"
so, I tried :
TalendDate.parseDate("MMM dd HH:mm:ss","Jun 30 12:16:45");

And finally this exception occurs:
Exception in component tJavaRow_6
java.lang.RuntimeException: java.text.ParseException: Unparseable date: "Jun 30 12:16:45"

I don't understand where is the problem... My pattern seams to be correct.
Thanks,
Labels (3)
1 Solution

Accepted Solutions
_AnonymousUser
Specialist III
Specialist III

Try:
(Relational.ISNULL(row5.Fecha_Entr_Prog))? TalendDate.parseDateLocale("yyyy-MM-dd HH:mm:ss","2013-02-09","EN") : TalendDate.parseDateLocale("yyyy-MM-dd",row5.Fecha_Entr_Prog,"EN")

View solution in original post

9 Replies
Anonymous
Not applicable
Author

Hi,
may be a problem with your locale. If it isn't set to English this wouldn't work i guess. Try to set a locale. I'm not sure but may be there is a method for parseDate which will allow a locale as parameter.
Bye
Volker
Anonymous
Not applicable
Author

Hello guy
Try
TalendDate.parseDateLocale("MMM dd HH:mm:ss","Jun 30 12:16:45","en");

Best regards

shong
Anonymous
Not applicable
Author

It was exactly the problem. If the locale isn't set, the date couldn't be parsed.
So, it's better to use directly parseDateLocal instead of a simply parseDate.
Thanks you!
_AnonymousUser
Specialist III
Specialist III

I ma tring to convert a date which is in string format to dd/mm/yyyy format.Please tell me the method in which i can do this
Anonymous
Not applicable
Author

TalendDate.parseDate("dd/mm/yyyy",Your Date);
This should parse your string to a date ..... also make changes to column where you are going to have this date,in Talend as well as in DB if you are passing it in DB.
Anonymous
Not applicable
Author

Hola a todos tengo el siguiente problema
utilizo la siguiente funcion
(row5.Fecha_Entr_Prog.equals("null"))? TalendDate.parseDateLocale("yyyy-MM-dd HH:mm:ss","2013-02-09","EN") : TalendDate.parseDateLocale("yyyy-MM-dd",row5.Fecha_Entr_Prog,"EN")
con el fin de evitar los null's pero cuando ejecuto la ETL me genera el siguiente error

java.lang.StringIndexOutOfBoundsException: String index out of range: 4
at java.lang.String.substring(Unknown Source)
si alguien me puede ayudar
_AnonymousUser
Specialist III
Specialist III

Try:
(Relational.ISNULL(row5.Fecha_Entr_Prog))? TalendDate.parseDateLocale("yyyy-MM-dd HH:mm:ss","2013-02-09","EN") : TalendDate.parseDateLocale("yyyy-MM-dd",row5.Fecha_Entr_Prog,"EN")
Anonymous
Not applicable
Author

Thankl you very much  it work
TalendDate.parseDateLocale("EEE MMM d HH:mm:ss zzz yyyy", "Sun Mar 06 11:28:16 IST 2011","en") 
Anonymous
Not applicable
Author

Thankl you very much  it work
TalendDate.parseDateLocale("EEE MMM d HH:mm:ss zzz yyyy", "Sun Mar 06 11:28:16 IST 2011","en")