text: import moment from 'moment';
  
  export function UTC(dttm) {
    return new Date(
      dttm.getUTCFullYear(),
      dttm.getUTCMonth(),
      dttm.getUTCDate(),
      dttm.getUTCHours(),
      dttm.getUTCMinutes(),
      dttm.getUTCSeconds(),
    );
  }
  
  export const fDuration = function (t1, t2, format = 'HH:mm:ss.SS') {
    const diffSec = t2 - t1;
    const duration = moment(new Date(diffSec));
    return duration.utc().format(format);
  };
  
  export const now = function () {
    // seconds from EPOCH as a float
    return moment().utc().valueOf();
  };
  
  export const epochTimeXHoursAgo = function (h) {
    return moment()
      .subtract(h, 'hours')
      .utc()
      .valueOf();
  };
  
  export const epochTimeXDaysAgo = function (d) {
    return moment()
      .subtract(d, 'days')
      .utc()
      .valueOf();
  };
  
  export const epochTimeXYearsAgo = function (y) {
    return moment()
      .subtract(y, 'years')
      .utc()
      .valueOf();
  };
  