源文件

This commit is contained in:
gyq
2024-05-23 14:39:33 +08:00
commit a1128dd791
2997 changed files with 500069 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
export function getDay(num, str) {
//如果要获取昨天的日期num就是-1 前天的就是-2依次类推。str表示年月日间的分割方式。
const today = new Date()
const nowTime = today.getTime()
const ms = 24 * 3600 * 1000 * num
today.setTime(nowTime + ms)
const oYear = today.getFullYear()
let oMoth = (today.getMonth() + 1).toString()
if (oMoth.length <= 1) oMoth = "0" + oMoth
let oDay = today.getDate().toString()
if (oDay.length <= 1) oDay = "0" + oDay
return oYear + str + oMoth + str + oDay
}