根據固定的時間,獲取到當前時間的月份的時間陣列

2022-08-20 22:54:12 字數 699 閱讀 2080

比如從2023年10月獲取到當前的時間的月份陣列

/*

* * 從固定的年月獲取到當前時間的陣列 倒序

* @param start_year 固定的年份 number 必傳

* @param start_mon 固定的月份 number 必傳

* @param type 需要'-'或不需要'' string 必傳 */

export

function

getpremonthday (start_year, start_mon, type)

else

if (parseint(mon1) > 12)

if (parseint(mon1) < 10)

arry.unshift();

} if (year1 >start_year)

if (parseint(mon2) <= 0)

else

if (parseint(mon2) > 12)

if (parseint(mon2) < 10)

list.unshift()}}

} let time =list.concat(arry);

return

time;

}

這個是倒序的,如果需要正序,就把unshift更改為push

C 根據當前時間獲取其他時間

datetime dt datetime.now 當前時間 datetime startweek dt.adddays 1 convert.toint32 dt.dayofweek.tostring d 本週周一 datetime endweek startweek.adddays 6 本週週日 d...

獲取當前時間

獲取日期 時間 datetime.now.tostring 2008 9 4 20 02 10 datetime.now.tolocaltime tostring 2008 9 4 20 12 12 獲取日期 datetime.now.tolongdatestring tostring 2008年9...

獲取當前時間

直接上可以執行的 檔案 獲取當前時間.cpp 方案 time 優點 僅使用c標準庫 缺點 只能精確到秒級 include time.h include stdio.h int main void 方案二getlocaltime 優點 能精確到毫秒級 缺點 使用了windows api include...