Sha256: b0f90947bcc62d25aff834b5fa51f6e1ee2aab0d6924adfe867e6f6aee7ba789
Contents?: true
Size: 790 Bytes
Versions: 1
Compression:
Stored size: 790 Bytes
Contents
'use strict'; /** * Pad a `number` with a ten's place zero. * * @param {number} number * @return {string} */ function pad(number) { var n = number.toString(); return n.length === 1 ? '0' + n : n; } /** * 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} */ 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'; } /* * Exports. */ module.exports = toISOString;
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
stylus-source-0.54.5 | vendor/node_modules/mocha/lib/to-iso-string/index.js |