Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi ,
how to get filedate. myfilename is pk_20110504124523.csv
i need the date format like this 2011-05-04 12:45:23
i tried like this ((String)globalMap.get("tFileList_2_CURRENT_FILE")).sub string(3,17) .am getting like this 20110504124523.
can any one help me.
try this
TalendDate.parseDate("yyyyMMddHHmmss",((String)globalMap.get("tFileList_2_CURRENT_FILE")).sub string(3,17)) with column type Date and pattern "yyyy-MM-dd HH:mm:ss" it must return proper result
try this
TalendDate.parseDate("yyyyMMddHHmmss",((String)globalMap.get("tFileList_2_CURRENT_FILE")).sub string(3,17)) with column type Date and pattern "yyyy-MM-dd HH:mm:ss" it must return proper result
Thank you so much this is working fine
@k526 wrote:
cannot convert from date to string
of course, because - it return Date (see my message)
if need string - add one more function formatDate() - it return string
TalendDate.formatDate("yyyy-MM-dd HH:mm:ss",TalendDate.parseDate("yyyyMMddHHmmss",((String)globalMap.get("tFileList_2_CURRENT_FILE")).sub string(3,17)) )
Welcome! 🙂