包含日期年月日時(shí)分秒網(wǎng)頁(yè)特效代碼的詞條
在代碼的body部分加上以下代碼,即可實(shí)現(xiàn)ltSCRIPT language=javascriptlt! BirthDay=new Datequotjanuary 01,2000quot改成計(jì)時(shí)日期 today=new Datetimeold=todaygetTimeBirthDaygetTimesectimeold=timeold1000 secondsold=MathfloorsectimeoldmsPerDay=24*60*60*1000 e_d。
m=new Arrayquot1月quot,quot2月quot,quot3月quot,quot4月quot,quot5月quot,quot6月quot,quot7月quot,quot8月quot,quot9月quot,quot10月quot,quot11月quot,quot12月quot date=new Date day=dategetDate year=dategetYear if year lt 2000 year=year+1900 TodaysDate=quot年 quot+mdategetMonth+quot quot+day+quot日 quot+ddategetDay。
字符串中的分隔符我們可以任意指定可以同時(shí)顯示年月日時(shí)分秒等 日期時(shí)間類timedelta時(shí)間間隔,即兩個(gè)時(shí)間點(diǎn)之間的時(shí)間長(zhǎng)度。
掃描二維碼推送至手機(jī)訪問。
版權(quán)聲明:本文由飛速云SEO網(wǎng)絡(luò)優(yōu)化推廣發(fā)布,如需轉(zhuǎn)載請(qǐng)注明出處。