简体   繁体   中英

How to format dates with Pentaho Spoon

How do I convert the string 03-MAR-2021 to the string 20210303 with Javascript in Pentaho Spoon

start_date="03-MAR-21";

var new_startDate= new Date(start_date);

var date= moment(new_startDate).format('yyyyMMdd');

See common date formats

start_date="03-MAR-2021";

var date= str2date(start_date, "dd-MMM-yyyy");

var formatedDateString = date2str(date, "yyyyMMdd");

I get the date in a string like '03-Mar-2021' but I need to convert to string '20210303' (YYYYMMDD) I can make in JScript or directly on Query. But I have problems when I try to

来自 ETL 的 Jscrip 错误 .... 见截图! .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM