Talend Date Format with Timestamp

  • Beitrags-Autor:
  • Beitrags-Kategorie:Allgemein

In t-map I find the current date with the talendDate.getCurrentDate() function, which specifies the date in the format „Thu Nov 13 12:37:34 IST 2008“. But my requirement is to get the date in the format „YYYY-mm-dd HH:mm:ss“. How can I change the date format Please help me solve this problem (or) Is there another way to get the date format „YYYY-mm-dd HH:mm:ss“ from today`s date? It throws an error such as „The parsedate(string,string) method in the talendate type is not applicable to argumnets(string,date)“ I use the following expression to realize:TalendDate.formatDate(„y-MM-dd HH:mm:ss“,TalendDate.parseDate(„EEE MMM dd HH:mm:ss z yyyy“,TalendDate.getCurrentDate())) You can directly return the TalendDate.getDate(„YYYY-mm-dd HH:mm:ss“), which returns the current date in the specified format. It returns a string, if you want it to be a date, you can combine it with the TalendDate.parseDate function. From this error, I can understand that the result of the TalendDate.getCurrentDate() function must be converted to a string before being used in the TalendDate.parseDate function. Please correct if my understanding is wrong.. .