time.wxs 449 B

1234567891011121314151617
  1. var formatDate = function (date) {
  2. var date = getDate(date);
  3. var year = date.getFullYear()
  4. var month = date.getMonth() + 1
  5. var day = date.getDay()
  6. var h = date.getHours();
  7. h = h < 10 ? ('0' + h) : h;
  8. var m = date.getMinutes();
  9. m = m < 10 ? ('0' + m) : m;
  10. var s = date.getSeconds();
  11. s = s < 10 ? ('0' + s) : s;
  12. return year + '/' + month + '/' + day + " " + h + ":" + m + ":" + s;
  13. }
  14. module.exports = {
  15. formatDate: formatDate
  16. }