Skip to content

Commit

Permalink
fea: use think.datetime to get current date time
Browse files Browse the repository at this point in the history
  • Loading branch information
welefen committed Feb 3, 2016
1 parent 2cce1d7 commit 461c4e8
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/core/think.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,15 +447,8 @@ think.log = (msg, type, showTime) => {
showTime = '';
}

let fn = d => {
return ('0' + d).slice(-2);
};

let d = new Date();
let date = `${d.getFullYear()}-${fn(d.getMonth() + 1)}-${fn(d.getDate())}`;
let time = `${fn(d.getHours())}:${fn(d.getMinutes())}:${fn(d.getSeconds())}`;

let dateTime = colors.gray(`[${date} ${time}] `);
let dateTime = colors.gray(`[${think.datetime()}] `);
if(showTime === null){
dateTime = '';
}
Expand Down

0 comments on commit 461c4e8

Please sign in to comment.