You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »


Problem 

Usually when exporting time duration information this comes in milliseconds. Here you will find a simple formula using javascript, to convert milliseconds into days, hours, minutes, and seconds.


Solution

This follow notation has javascript embedded.

%{var seconds = Math.floor(${MTRS} / 1000); var minute = Math.floor(seconds / 60); seconds = seconds % 60; var hour = Math.floor(minute / 60); minute = minute % 60; var day = Math.floor(hour / 24); hour = hour % 24; day + " days " + hour  + " hours " + minute + " minute " + seconds + " seconds"}

Link for related documentation

Here you will find information about using Javascript in Xporter.







  • No labels