analytics.js
function toIsoString (date) {
  return date.getUTCFullYear()
    + '-' + pad(date.getUTCMonth() + 1)
    + '-' + pad(date.getUTCDate())
    + 'T' + pad(date.getUTCHours())
    + ':' + pad(date.getUTCMinutes())
    + ':' + pad(date.getUTCSeconds())
    + '.' + String((date.getUTCMilliseconds()/1000).toFixed(3)).slice(2, 5)
    + 'Z';
}
function toIsoString (date) {
  return date.getUTCFullYear()
    + '-' + pad(date.getUTCMonth() + 1)
    + '-' + pad(date.getUTCDate())
    + 'T' + pad(date.getUTCHours())
    + ':' + pad(date.getUTCMinutes())
    + ':' + pad(date.getUTCSeconds())
    + '.' + String((date.getUTCMilliseconds()/1000).toFixed(3)).slice(2, 5)
    + 'Z';
}
function toIsoString ( date ) { return date . getUTCFullYear ( ) + '-' + pad ( date . getUTCMonth ( ) + 1 ) + '-' + pad ( date . getUTCDate ( ) ) + 'T' + pad ( date . getUTCHours ( ) ) + ':' + pad ( date . getUTCMinutes ( ) ) + ':' + pad ( date . getUTCSeconds ( ) ) + '.' + String ( ( date . getUTCMilliseconds ( ) / 1000 ) . toFixed ( 3 ) ) . slice ( 2 , 5 ) + 'Z' ; }
Turn a `date` into an ISO string.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString

@param {Date} date
@return {String}
Turn a date into an ISO string .