• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] convert bigdecimal yyyymmdd(20110701) to date (yyyy-mm-dd)2011-07-01

#1 2012-06-04 15:35:05

merouan
New member
Registered: 2012-01-04
Posts: 1

[resolved] convert bigdecimal yyyymmdd(20110701) to date (yyyy-mm-dd)2011-07-01

hi,
is there a way to convert bigdecimal yyyymmdd(20110701)  format to data format like this (yyyy-mm-dd)2011-07-01, using tmap componement?

Thanks for help

Offline

#2 2012-06-05 05:06:54

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: [resolved] convert bigdecimal yyyymmdd(20110701) to date (yyyy-mm-dd)2011-07-01

Hi

Welcome to Talend Community!

The expression may be a little complex but works fine.

Code:

TalendDate.parseDate("yyyy-MM-dd",TalendDate.formatDate("yyyy-MM-dd",TalendDate.parseDate("yyyyMMdd",row1.newColumn.toString())))

Regards,
Pedro


Only Paranoid Survive.

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] convert bigdecimal yyyymmdd(20110701) to date (yyyy-mm-dd)2011-07-01

Board footer

Powered by FluxBB