
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Try this expression to convert the string date to a Date.
TalendDate.parseDateLocale("EEE MMM dd HH:mm:ss Z yyyy", stringValueColumn,"EN")

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Try this expression to convert the string date to a Date.
TalendDate.parseDateLocale("EEE MMM dd HH:mm:ss Z yyyy", stringValueColumn,"EN")

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tks, it worked!!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Chitrang Sharma , can you explain this timestamp? What do you expect to output?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
