## 吉神凶煞 1. .getDayJiShen() > 获取当日的吉神,返回数组(或列表),如果没有并不是返回一个空数组(或列表),而是返回['无'] 2. .getDayXiongSha() > 获取当日的凶煞,返回数组(或列表),如果没有并不是返回一个空数组(或列表),而是返回['无'] ### 示例代码
javascript
java
csharp
php
python
go
var d = Lunar.fromDate(new Date()); // 吉神宜趋 var l = d.getDayJiShen(); for (var i=0, j=l.length; i<j; i++){ console.log(l[i]); } // 凶煞宜忌 l = d.getDayXiongSha(); for (var i=0, j=l.length; i<j; i++){ console.log(l[i]); }
Lunar d = Lunar.fromDate(new Date()); // 吉神宜趋 List<String> l = d.getDayJiShen(); for (String s:l){ System.out.println(s); } // 凶煞宜忌 l = d.getDayXiongSha(); for (String s:l){ System.out.println(s); }
Lunar d = Lunar.fromDate(new Date()); // 吉神宜趋 List<string> l = d.getDayJiShen(); foreach(string s in l) { Console.WriteLine(s); } // 凶煞宜忌 l = d.getDayXiongSha(); foreach(string s in l) { Console.WriteLine(s); }
$d = Lunar::fromDate(new DateTime()); // 吉神宜趋 $l = $d->getDayJiShen(); foreach ($l as $s) { echo $s . "\n"; } // 凶煞宜忌 $l = $d->getDayXiongSha(); foreach ($l as $s) { echo $s . "\n"; }
d = Lunar.fromDate(datetime.now()) # 吉神宜趋 l = d.getDayJiShen() for s in l: print s # 凶煞宜忌 l = d.getDayXiongSha() for s in l: print s
d := calendar.NewLunarFromDate(time.Now()) // 吉神宜趋 l := d.GetDayJiShen() for i := l.Front(); i != nil; i = i.Next() { fmt.Println(i.Value.(string)) } // 凶煞宜忌 l = d.GetDayXiongSha() for i := l.Front(); i != nil; i = i.Next() { fmt.Println(i.Value.(string)) }
### 输出