Files
vczero.github.io/tuban/lib/services/time.js
T
2014-12-26 17:02:29 +08:00

13 lines
305 B
JavaScript

app.service('Time', function() {
return {
formatTime: function(date) {
var time = new Date(date);
return time.getFullYear() + '-' +
(parseInt(time.getMonth()) + 1) + '-' +
time.getDate() + ' ' +
time.getHours() + ':' +
time.getMinutes() + ':' +
time.getSeconds();
}
};
});