Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Igor2
Contributor II
Contributor II

Convert String to Date in TMap

Hi ,

How can i convert string whose value is "Wed Dec 23 00:00:00 BRST 2015" to date format ?

I need this format : "dd -MM-yyyy " 

 

I'am trying like this(image) in my TMap:

 

But is not working, i got this error message:

Exception in component tMap_2 (Cargaxxx)

java.lang.RuntimeException: java.text.ParseException: Unparseable date: "Wed Dec 23 00:00:00 BRST 2015"

at routines.TalendDate.parseDate(TalendDate.java:943)

at routines.TalendDate.parseDate(TalendDate.java:887)

at xx.carga_xxx.Carga_xxx.tFileInputExcel_1Process(Carga_xxx.java:15673)

at xxx.carga_xxx0_1.Carga_xxx.runJobInTOS(Cargaxxx.java:17870)

at xxx.carga_basexxx_0_1.Cargaxxx.main(Carga_xxx.java:17678)

Caused by: java.text.ParseException: Unparseable date: "Wed Dec 23 00:00:00 BRST 2015"

at java.text.DateFormat.parse(Unknown Source)

at routines.TalendDate.parseDate(TalendDate.java:929)

... 4 more

Tks

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi

Try this expression to convert the string date to a Date.

TalendDate.parseDateLocale("EEE MMM dd HH:mm:ss Z yyyy", stringValueColumn,"EN")

View solution in original post

5 Replies
Anonymous
Not applicable

Hi

Try this expression to convert the string date to a Date.

TalendDate.parseDateLocale("EEE MMM dd HH:mm:ss Z yyyy", stringValueColumn,"EN")

Igor2
Contributor II
Contributor II
Author

Tks, it worked!!

CSharma1636705679
Contributor
Contributor

Hi, how can I do it if my string is a timestamp

I am getting  Unparseable date: "1631898440" error.

My String is this - "1631898440" which is a timestamp. Please help

 

Anonymous
Not applicable

@Chitrang Sharma​ , can you explain this timestamp? What do you expect to output?

 

CSharma1636705679
Contributor
Contributor

I am getting this timestamp as String after conversion it should be like - 9/17/2021, 10:37:20 PM

 

I tried this - row5.stripe_invoicejson!=null && !"".equalsIgnoreCase(row5.stripe_invoicejson)?TalendDate.parseDate("MMddyyyy",row5.stripe_invoicejson):null 

 

But I am getting timestamp out of range: "898441-05-01 00:00:00+05:30" err