正月初八,开工大吉
Posted 尔嵘
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了正月初八,开工大吉相关的知识,希望对你有一定的参考价值。
正月初八,开工大吉
/**
* Get System Date Or DateTime
* @param dateVal timeStramp
* @param 0 as Date 1 as DateTime 2 as DateTimeMilliseconds 3 as YearMonth
*/
export function getSystemDate(param, dateVal)
let systemDate = dateVal ? new Date(dateVal) : new Date(),
year = systemDate.getFullYear(),
month = systemDate.getMonth() + 1,
date = systemDate.getDate(),
hours = systemDate.getHours(),
minutes = systemDate.getMinutes(),
seconds = systemDate.getDate(),
milliseconds = systemDate.getMilliseconds();
month = month < 10 ? '0' + month : month;
date = date < 10 ? '0' + date : date;
hours = hours < 10 ? '0' + hours : hours;
minutes = minutes < 10 ? '0' + minutes : minutes;
seconds = seconds < 10 ? '0' + seconds : seconds;
if (param == 0)
return year + '-' + month + '-' + date;
else if (param == 1)
return year + '-' + month + '-' + date + " " + hours + ":" + minutes + ":" + seconds;
else if (param == 2)
return year + '-' + month + '-' + date + " " + hours + ":" + minutes + ":" + seconds + '.' + milliseconds;
else if (param == 3)
return year + '-' + month;
else if (param == 4)
return year
以上是关于正月初八,开工大吉的主要内容,如果未能解决你的问题,请参考以下文章