## 实例化 佛历的实例化有以下几种方式: 1. Foto.fromYmd(year, month, day) > 指定
佛历年(数字)
、
佛历月(数字)
、
佛历日(数字)
生成佛历对象。注意佛历月和佛历日与阴历相同。 2. Foto.fromYmdHms(year, month, day, hour, minute, second) > 指定
佛历年(数字)
、
佛历月(数字)
、
佛历日(数字)
、
阳历小时(数字)
、
阳历分钟(数字)
、
阳历秒钟(数字)
生成佛历对象。注意佛历月和佛历日与阴历相同。 3. Foto.fromLunar(lunar) > 指定
阴历对象(lunar)
生成佛历对象 ### 示例代码
javascript
java
csharp
php
python
go
var d = Foto.fromLunar(Lunar.fromDate(new Date())); console.log(d); console.log(d.toFullString());
Foto d = Foto.fromLunar(Lunar.fromDate(new Date())); System.out.println(d); System.out.println(d.toFullString());
Foto d = Foto.fromLunar(Lunar.fromDate(new Date())); Console.WriteLine(d); Console.WriteLine(d.toFullString());
$d = Foto::fromLunar(Lunar::fromDate(new DateTime())); echo $d."\n"; echo $d->toFullString()."\n";
d = Foto.fromLunar(Lunar.fromDate(datetime.now())) print d print d.toFullString()
d := calendar.NewFotoFromLunar(calendar.NewLunarFromDate(time.Now())) fmt.Println(d) fmt.Println(d.ToFullString())
### 输出