const mwUtils = { timeToStr: function (time) { let timeData = new Date(parseInt(time)) let year = timeData.getFullYear() let month = (timeData.getMonth() + 1) >= 10 ? timeData.getMonth() + 1 : `0${timeData.getMonth() + 1}` let date = timeData.getDate().length >= 10 ? timeData.getDate() : `0${timeData.getDate()}` let hour = timeData.getHours() >= 10 ? timeData.getHours() : `0${timeData.getHours()}` let minute = timeData.getMinutes().toString().length > 1 ? timeData.getMinutes() : `0${timeData.getMinutes()}` return `${year}年${month}月${date}日 ${hour}:${minute}` } } export { mwUtils }