Lunar Solar Calendar Converter
公历(阳历) 农历(阴历)转换,支持时间段从1900-2100 如果需要更长的时间段,利用generate.htm生成的数据即可。 支持各种编程语言 C#,java,Objective-C,php,Python,javascript(nodejs),C/C++,ruby,swift等 支持Mac,Windows,Android,WP多种平台
数据验证
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的数据比对
基本原理
查表。有2个数据表,对于每一年,一张表存着X年正月初一对应的公历年月日,另一张表存着X年农历每个月的天数以及闰月的月份。 然后根据这两张表进行日期的偏移。
所有数据通过了微软ChineseLunisolarCalendar类的比对。比对程序在C#版本中。
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/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
Metadata
Release files for LunarSolarConverter 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| LunarSolarConverter-1.1.0.tar.gz | 5.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| LunarSolarConverter-1.1.0-py2.7.egg | Legacy Egg format | - | - | Details |
Total release size: 17.7 kB
Release files / LunarSolarConverter-1.1.0.tar.gz
| Download URL | LunarSolarConverter-1.1.0.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
78dcde00f02944d9059042198e55c8fb90b5be05209a5fb9cf3ec57f102d68c4
|
|
BLAKE2b-256 checksum How to use checksums |
4d727028dde86f46e7966d72bc66571aa142d6474a4666ae29530a06d43c2ce6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / LunarSolarConverter-1.1.0-py2.7.egg
| Download URL | LunarSolarConverter-1.1.0-py2.7.egg |
|---|---|
| Size | 11.8 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
006ae9cef711090f80837499deec84c47a02afb34ce773baf265efb277282046
|
|
BLAKE2b-256 checksum How to use checksums |
81953716fab1703002505eb436573bb5335d3a2d8c7c7451afc32a38b03e221d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for LunarSolarConverter 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.