globalfunc.js 389 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/* Wrap a callback, reduce code amount */
function wrapCB(callback, input) {
  if (typeof callback === 'function') {
    callback(input);
  }
  return;
}
global.wrapCB = wrapCB;
function toTaosTSString(date) {
  date = new Date(date);
  let tsArr = date.toISOString().split("T")
  return tsArr[0] + " " + tsArr[1].substring(0, tsArr[1].length-1);
}
global.toTaosTSString = toTaosTSString;