last-modified-to-string.js 351 B

12345678910
  1. 'use strict';
  2. module.exports = function lastModifiedToString(stat) {
  3. const t = new Date(stat.mtime);
  4. return (('0' + (t.getDate())).slice(-2) + '-' +
  5. t.toLocaleString('default', { month: 'short' }) + '-' +
  6. t.getFullYear() + ' ' +
  7. ('0' + t.getHours()).slice(-2) + ':' +
  8. ('0' + t.getMinutes()).slice(-2));
  9. };