lib/helpers.js
function formatDate(date) {
  let timestamp;
  if (date instanceof Date) {
    // Datadog expects seconds.
    timestamp = Math.round(date.getTime() / 1000);
  } else if (date instanceof Number) {
    // Make sure it is an integer, not a float.
    timestamp = Math.round(date);
  }
  return timestamp;
}
function formatDate(date) {
  let timestamp;
  if (date instanceof Date) {
    // Datadog expects seconds.
    timestamp = Math.round(date.getTime() / 1000);
  } else if (date instanceof Number) {
    // Make sure it is an integer, not a float.
    timestamp = Math.round(date);
  }
  return timestamp;
}
function formatDate ( date ) { let timestamp ; if ( date instanceof Date ) { // Datadog expects seconds. timestamp = Math . round ( date . getTime ( ) / 1000 ) ; } else if ( date instanceof Number ) { // Make sure it is an integer, not a float. timestamp = Math . round ( date ) ; } return timestamp ; }
Formats a date for use with DataDog
Formats a date for use with DataDog