tChronometerStop Readable Time

Hi Guys
Spent a while working out a way to display the Job's Duration in Hours:minutes:seconds
This is the solution I found.
tChronometerStop_1 -- On Component Ok --> tJava





The Code to work out the time from milliseconds to HH:mm:ss is below:
TalendDate.formatDate("HH:mm:ss", TalendDate.parseDate("ss", String.valueOf(((Long)globalMap.get("tChronometerStop_1_DURATION"))/1000)))

For Example:
tChronometerStop_1 puts out - 5000
After formatDate you get - 00:00:05
This can also be done by setting a startTime and endTime variable and use TalendDate.diffDate to work out the Job's duration
Regards
Brandon Smiley Happy
1 REPLY
Community Manager

Re: tChronometerStop Readable Time

Hi Brandon
Thanks for your job and experience! Smiley Happy
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business