本文为大家分享了一段js显示阴历(农历)和当前日期的关键性代码,供大家参考,具体内容如下
var CalendarData=new Array(100);
var madd=new Array(12);
var tgString="甲乙丙丁戊己庚辛壬癸";
var dzString="子丑寅卯辰巳午未申酉戌亥";
var numString="一二三四五六七八九十";
var monString="正二三四五六七八九十冬腊";
var weekString="日一二三四五六";
var sx=
代码如下:[removed] var CalendarData = new Array(100); var madd = new Array(12); var tgString = “甲乙丙丁戊己庚辛壬癸”; var dzString = “子丑寅卯辰巳午未申酉戌亥”; var numString = “一二三四五六七八九十”; var monString = “正二三四五六七八九十冬腊”; var weekString = “日一二三四五六”;
1.显示日期代码:
Js代码
/*获取当前日期*/
function getCurrentDateTime() {
var d = new Date();
var year = d.getFullYear();
var month = d.getMonth() + 1;
var date = d.getDate();
var week = d.getDay();
/*时分秒*/
/*var hours = d.getHours();
var minutes = d.getMinutes();