1 |
|
2 |
|
3 |
|
4 | var pad = function pad(n) {
|
5 | return (n < 10 ? '0' : '') + n;
|
6 | };
|
7 |
|
8 | var _toISOString = typeof Date.prototype.toISOString === 'function' ? function _toISOString(d) {
|
9 | return d.toISOString();
|
10 | } : function _toISOString(d) {
|
11 | return d.getUTCFullYear() + '-' + pad(d.getUTCMonth() + 1) + '-' + pad(d.getUTCDate()) + 'T' + pad(d.getUTCHours()) + ':' + pad(d.getUTCMinutes()) + ':' + pad(d.getUTCSeconds()) + '.' + (d.getUTCMilliseconds() / 1000).toFixed(3).slice(2, 5) + 'Z';
|
12 | };
|
13 |
|
14 | module.exports = _toISOString; |
\ | No newline at end of file |