以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  公农历转换  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=146796)

--  作者:nuonuo
--  发布时间:2020/3/2 17:56:00
--  公农历转换
老师,请问如何将农历的日期转换成公历呢?

已知,New Lunar(Year, Month, Day, Leap)的语法可以封装农历对象,但是Leap需要判断该农历日期是否为闰月,如果指定任一农历日期,如何判断是否为闰月呢?


--  作者:有点蓝
--  发布时间:2020/3/2 20:02:00
--  

定义一个Lunar的语法有两种。

语法一

New Lunar(Date)

Date: 公历日期

示例

\'输出2002年3月17日对应的农历日期
Dim
 ln As New Lunar(#3/17/2002#)
output
.show(ln.LunarDate)
\'输出2006年8月25日对应的农历日期

ln = New Lunar(
#8/25/2006#)
Output.show(ln.LunarDate)

If
 ln.IsLeapMonth Then
    Output.Show(
"这是闰月!")
End If