_x000D_
/**_x000D_
* Get Two Time Different_x000D_
* @param join_x000D_
* @param lastSeen_x000D_
* @param now_x000D_
* @returns {string}_x000D_
*/_x000D_
function getTimeDiff( join, lastSeen, now = false)_x000D_
{_x000D_
let t1 = new Date(join).getTime(), t2 = new Date(lastSeen).getTime(), milliseconds =0, time ='';_x000D_
if (now) t2 = Date.now();_x000D_
if( isNaN(t1) || isNaN(t2) ) return '';_x000D_
if (t1 < t2) milliseconds = t2 - t1; else milliseconds = t1 - t2;_x000D_
var days = Math.floor(milliseconds / 1000 / 60 / (60 * 24));_x000D_
var date_diff = new Date( milliseconds );_x000D_
if (days > 0) time += days + 'd ';_x000D_
if (date_diff.getHours() > 0) time += date_diff.getHours() + 'h ';_x000D_
if (date_diff.getMinutes() > 0) time += date_diff.getMinutes() + 'm ';_x000D_
if (date_diff.getSeconds() > 0) time += date_diff.getSeconds() + 's ';_x000D_
return time;_x000D_
}_x000D_
_x000D_
_x000D_
console.log(getTimeDiff(1578852606608, 1579530945513));_x000D_
_x000D_