/**
|
* @description 获取年月日 时分秒
|
* @returns {string} yyyy-MM-dd hh:mm:ss
|
*/
|
export function getDate() {
|
const date = new Date();
|
let str = date.getFullYear() + '-' + addZero(date.getMonth() + 1) + '-' + addZero(date.getDate());
|
|
// if (option && option.full) {
|
str += ' ' + addZero(date.getHours()) + ':' + addZero(date.getMinutes()) + ':' + addZero(date.getSeconds());
|
// }
|
return str;
|
}
|
const addZero = function(date) {
|
return date > 9 ? date : '0'+date;
|
};
|