Lunar Solar Calendar Converter
Gregorian (solar) lunar (lunar) conversion, support period from 1900-2100
If a longer period of time is required, the data generated by generate.htm can be used.
Supports various programming languages C#,java,objective-c,php,python,javascript (Nodejs), C/c++,ruby,swift, etc.
Support MAC,WINDOWS,ANDROID,WP Multiple Platforms
Data validation
1.用io.js(nodejs)写了一个httpserver,各种语言可以通过下面的http接口验证不同实现的数据一致性。在javascript目录下node check.js启动2.http://localhost:1337/?src=2015,1,15 (公历转农历,返回2014,11,25,0) 或者 http://localhost:1337/?src=2014,11,25,0 (农历转公历,返回2015,1,15)3.比如在C#版本中,Check.cs 实现了C#与nodejs的数据比对
Basic principle
- Tabular There are 2 data sheets, for each year, a table with the first day of the first month of the lunar calendar, and the other table with the X-year of the lunar calendar of days and months of the leap months. The dates are then offset according to the two tables.
- All the data passed the comparison of Microsoft Chineselunisolarcalendar class. The comparison program is in the C # version.
API for CSharp or Java
/***农历转公历*/public static Solar LunarToSolar(Lunar lunar)/***公历转农历*/public static Lunar SolarToLunar(Solar solar)
API for Objective-c
/***农历转公历*/+ (Solar *)lunarToSolar:(Lunar *)lunar;/***公历转农历*/+ (Lunar *)solarToLunar:(Solar *)solar;
API for PHP
/***农历转公历*/public static function LunarToSolar($lunar)/***公历转农历*/public static function SolarToLunar($solar)
API for Python
/***农历转公历*/def LunarToSolar(self, lunar):/***公历转农历*/def SolarToLunar(self, solar):
API for JavaScript
/***农历转公历*/this.LunarToSolar = function (lunar)/***公历转农历*/this.SolarToLunar = function (solar)
API for C + +
/***农历转公历*/Solar LunarToSolar(Lunar lunar);/***公历转农历*/Lunar SolarToLunar(Solar solar);
API for Ruby
/***农历转公历*/def LunarToSolar(lunar)/***公历转农历*/def SolarToLunar(solar)
API for Swift
/***农历转公历*/class func LunarToSolar( lunar:Lunar)->Solar/***公历转农历*/class func SolarToLunar( solar:Solar)->Lunar
Open source Multi-language Gregorian lunar calendar conversion