I am having a date column in string format, but I want to change that string into date format using with tmap in Talend. Now could you please tell me which expression I need to use to change the format from string to date.
Asked
Active
Viewed 3,950 times
1 Answers
0
You can use the in-built Talend Java routines for this purpose in a tMap.
Here is an example:
TalendDate.parseDate("yyyy-MM-dd", row1.dateStr)

gil.fernandes
- 12,978
- 5
- 63
- 76
-
TalendDate.Format("yyyy-MM-dd HH:mm:ss",TalendDate.parsedate("MM/dd/yy",column) – Naresh AR Oct 03 '17 at 18:09
-
1This expression will convert from string in one format to string in another format. As I understood your question you wanted to convert from "string" to "date". – gil.fernandes Oct 03 '17 at 18:12
-
Hi, I want to do something similar I am having timestamp as string I want to convert it into date timestamp but I am getting two exceptions 1- : String index out of range: 13 and 2 - Unparseable date: "1631898440" – Amara Dec 07 '21 at 07:31
-
@CS. Perhaps you need to convert the numeric timestamp to a date object first (e.g `new Date(Long.parseLong("1631898440"))`) and then use something like `TalendDate.Format("yyyy-MM-dd HH:mm:ss",TalendDate.parsedate("MM/dd/yy",column)` – gil.fernandes Dec 07 '21 at 08:39