## 阴历时辰对象 阴历时辰对象封装了与时辰有关的信息。 1. LunarTime.fromYmdHms(lunarYear, lunarMonth, lunarDay, hour, minute, second) > 指定
阴历年(数字)
、
阴历月(数字)
、
阴历日(数字)
、
小时
、
分钟
、
秒数
生成阴历时辰对象。 2. .getGan() > 获取时辰天干 3. .getZhi() > 获取时辰地支 4. .getGanZhi() > 获取时辰干支 5. .getShengXiao() > 获取生肖 6. .getPositionXi() > 获取喜神方位 7. .getPositionXi() > 获取喜神方位 8. .getPositionXiDesc() > 获取喜神方位描述 9. .getPositionYangGui() > 获取阳贵神方位 10. .getPositionYangGuiDesc() > 获取阳贵神方位描述 11. .getPositionYinGui() > 获取阴贵神方位 12. .getPositionYinGuiDesc() > 获取阴贵神方位描述 13. .getPositionFu() > 获取福神方位 14. .getPositionFuDesc() > 获取福神方位描述 15. .getPositionCai() > 获取财神方位 16. .getPositionCaiDesc() > 获取财神方位描述 17. .getNaYin() > 获取纳音 18. .getTianShen() > 获取天神 19. .getTianShenType() > 获取天神类型:黄道/黑道 20. .getTianShenLuck() > 获取值时天神吉凶:吉/凶 21. .getChong() > 获取时冲 22. .getSha() > 获取时煞 23. .getChongShengXiao() > 获取时冲生肖 24. .getChongDesc() > 获取时冲描述 25. .getChongGan() > 获取无情之克的时冲天干 26. .getChongGanTie() > 获取有情之克的时冲天干 27. .getYi() > 获取宜,如果没有,返回["无"] 28. .getJi() > 获取忌,如果没有,返回["无"] 29. .getNineStar() > 获取值时[九星](lunar.nine.html) 30. .getXun() > 获取所在旬 31. .getXunKong() > 获取值时空亡 32. .getMinHm() > 获取当前时辰的最早时分,如:21:00 33. .getMaxHm() > 获取当前时辰的最晚时分,如:22:59 34. .toString() > 获取字符串输出,默认输出干支 ### 示例代码
javascript
// 2000年正月初一 19:30 var lunarTime = LunarTime.fromYmdHms(2000, 1, 1, 19, 30, 0); console.log('干: ' + lunarTime.getGan()); console.log('支: ' + lunarTime.getZhi()); console.log('干支: ' + lunarTime.getGanZhi()); console.log('生肖: ' + lunarTime.getShengXiao()); console.log('喜神方位: ' + lunarTime.getPositionXi()); console.log('喜神方位描述: ' + lunarTime.getPositionXiDesc()); console.log('阳贵神方位: ' + lunarTime.getPositionYangGui()); console.log('阳贵神方位描述: ' + lunarTime.getPositionYangGuiDesc()); console.log('阴贵神方位: ' + lunarTime.getPositionYinGui()); console.log('阴贵神方位描述: ' + lunarTime.getPositionYinGuiDesc()); console.log('福神方位: ' + lunarTime.getPositionFu()); console.log('福神方位描述: ' + lunarTime.getPositionFuDesc()); console.log('财神方位: ' + lunarTime.getPositionCai()); console.log('财神方位描述: ' + lunarTime.getPositionCaiDesc()); console.log('纳音: ' + lunarTime.getNaYin()); console.log('天神: ' + lunarTime.getTianShen()); console.log('天神类型: ' + lunarTime.getTianShenType()); console.log('天神吉凶: ' + lunarTime.getTianShenLuck()); console.log('冲: ' + lunarTime.getChong()); console.log('煞: ' + lunarTime.getSha()); console.log('冲生肖: ' + lunarTime.getChongShengXiao()); console.log('冲描述: ' + lunarTime.getChongDesc()); console.log('无情之克冲天干: ' + lunarTime.getChongGan()); console.log('有情之克冲天干: ' + lunarTime.getChongGanTie()); console.log('宜: ' + lunarTime.getYi()); console.log('忌: ' + lunarTime.getJi()); console.log('九星: ' + lunarTime.getNineStar()); console.log('旬: ' + lunarTime.getXun()); console.log('旬空: ' + lunarTime.getXunKong()); console.log('时间段: ' + lunarTime.getMinHm() + '-' + lunarTime.getMaxHm());
### 输出