## 获取星期 阴历对象也可直接获取星期,同样提供两种星期表示方式: 1. .getWeek() > 获取星期数字,0代表星期日,1代表星期一,6代表星期六 2. .getWeekInChinese() > 获取星期的中文:日一二三四五六 中国古代也用“七曜日”来表示星期,详见
七政(七曜)
。 ### 示例代码
javascript
java
csharp
php
python
go
var d = Lunar.fromDate(new Date()); console.log(d.getWeek()); console.log(d.getWeekInChinese());
Lunar d = Lunar.fromDate(new Date()); System.out.println(d.getWeek()); System.out.println(d.getWeekInChinese());
Lunar d = Lunar.fromDate(new Date()); Console.WriteLine(d.getWeek()); Console.WriteLine(d.getWeekInChinese());
$d = Lunar::fromDate(new DateTime()); echo $d->getWeek()."\n"; echo $d->getWeekInChinese()."\n";
d = Lunar.fromDate(datetime.now()) print d.getWeek() print d.getWeekInChinese()
d := calendar.NewLunarFromDate(time.Now()) fmt.Println(d.GetWeek()) fmt.Println(d.GetWeekInChinese())
### 输出