You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

util.js 513B

1
  1. const formatTime=t=>{const e=t.getFullYear(),o=t.getMonth()+1,r=t.getDate(),m=t.getHours(),a=t.getMinutes(),n=t.getSeconds();return[e,o,r].map(formatNumber).join("/")+" "+[m,a,n].map(formatNumber).join(":")},formatNumber=t=>(t=t.toString())[1]?t:"0"+t,formatDate=t=>{const e=t.getFullYear(),o=t.getMonth()+1,r=t.getDate(),m=t.getHours(),a=t.getMinutes(),n=t.getSeconds();return[e,o,r].map(formatNumber).join("")+" "+[m,a,n].map(formatNumber).join("")};module.exports={formatTime:formatTime,formatDate:formatDate};