KO
|
EN
gitlite — search
Search
#nodejs
#react
#javascript
#api
#python
#typescript
#solidity
#docker
#mongodb
#node
#hardhat
#machine-learning
Almanac
★ 36
Open GitHub ↗
Almanac 历
Download README (.md)
Explore Similar Repositories
almanack
:
Aggregate iCal and Google Calendar events. Pluggable or standalone app. UI optional and 100% customisable.
centos2alma
:
CentOS 7 to AlmaLinux 8 conversion tool
SpineOMatic
:
Spine label printing for Ex Libris' Alma
almanac
:
中国日历,中国农历,阴历,360日历,基于jQuery的实现
almanac-retrieval
:
Almanac: Retrieval-Augmented Language Models for Clinical Medicine
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
Almanac
?
Download (.md)
# Almanac 历 [](https://github.com/HuangDayu/Almanac/watchers) [](https://github.com/HuangDayu/Almanac/issues) [](https://github.com/HuangDayu/Almanac/network) [](https://github.com/HuangDayu/Almanac/stargazers) [](https://github.com/996icu/996.ICU/blob/master/LICENSE) [](https://996.icu/#/zh_CN) <!-- [](https://github.com/HuangDayu/Almanac) --> 本项目学习[寿星天文历](http://www.nongli.net/sxwnl/)和[日梭万年历](https://www.nongli114.com/rili/),包括但不限皇历、生辰八字、日出月落、农历、黄历、干支、节气、月相、经纬度、节假日、伊斯兰历、儒略历、天文历、回历、西历等日历数据和天文数据的计算,支持年、月、日的计算范围。 本项目部分源码源于开源(包括核心算法),我在此基础之上做了修修补补,所以也完全开源,但本项目仅供用于学习,无授权许可,禁止商用。 ## 如何使用 ### 引入依赖 ```xml <dependency> <groupId>cn.huangdayu</groupId> <artifactId>almanac</artifactId> <version>20211128</version> </dependency> ``` ### 代码示例 ```java /** * @author huangdayu at 2024/7/21 create */ public class AlmanacRunner { public static void main(String[] args) { // 构造历法对象 Almanac almanac = new Almanac(new TimeZoneDTO("广东省", "徐闻县", new GregorianCalendar())); // 获取当天的历法信息 almanac.dayAlmanac().getAllInfo().forEach((k, v) -> System.out.println(k + " : " + v)); // 获取当月的历法信息 for (AlmanacDTO almanacDTO : almanac.monthAlmanac()) { almanacDTO.getAllInfo().forEach((k, v) -> System.out.println(k + " : " + v)); } // 获取当年的历法信息 for (AlmanacDTO[] almanacDTOS : almanac.yearAlmanac()) { for (AlmanacDTO almanacDTO : almanacDTOS) { almanacDTO.getAllInfo().forEach((k, v) -> System.out.println(k + " : " + v)); } } } } ``` ### 数据示例 | key | value | value | value | | :--------: | :-------- | :-------- | :-------- | | `日期` | 2018年11月01日 | 1995年08月12日 | 0001年01月01日 | | `时间` | 11时06分48秒667毫秒 | 11时10分10秒00毫秒 | 11时10分10秒00毫秒 | | `星期` | 星期四 | 星期六 | 星期一 | | `地点` | 广东 徐闻 | 广东 徐闻 | 广东 徐闻 | | `年号` | [当代]新中国 公历纪元2018年 | [当代]新中国 公历纪元1995年 | [西汉]平帝 刘衍 元始1年 | | `农历` | 戊戌狗年玖月廿四 | 乙亥猪年柒月十七 | 庚申鸡年冬月十八 | | `时辰` | 午时 | 午时 | 午时 | | `黄历` | 戊戌年壬戌月丁酉日丙午时 | 乙亥年甲申月乙亥日壬午时 | 庚申年戊子月丁丑日丙午时 | | `天干` | 戊壬丁丙 | 乙甲乙壬 | 庚戊丁丙 | | `地支` | 戌戌酉午 | 亥申亥午 | 申子丑午 | | `八字` | 戊戌壬戌丁酉丙午 | 乙亥甲申乙亥壬午 | 庚申戊子丁丑丙午 | | `回历` | 1440年2月21日 | 1416年3月15日 | -640年5月16日 | | `儒略日` | 2458424 | 2449942 | 1721426 | | `黄帝纪年` | 开元4716年 | 开元4693年 | 开元2698年 | | `生肖` | 狗 | 猪 | 鸡 | | `节假日` | 无 | 无 | 一九第8天 | | `经度` | 东经 110°16'67" | 东经 110°16'67" | 东经 110°16'67" | | `纬度` | 北纬 20°33'33" | 北纬 20°33'33" | 北纬 20°33'33" | | `时区` | +0800 东八区 | +0800 东八区 | +0800 东八区 | | `港口` | 乌石港 | 乌石港 | 乌石港 | | `昼长` | 11:22:55 | 12:52:48 | 10:54:50 | | `夜长` | 12:37:04 | 11:07:11 | 13:05:09 | | `天亮` | 06:18:41 | 05:55:05 | 06:50:20 | | `日出` | 06:41:27 | 06:18:10 | 07:14:22 | | `中天` | 12:22:54 | 12:44:34 | 12:41:47 | | `日落` | 18:04:22 | 19:10:58 | 18:09:12 | | `天黑` | 18:27:07 | 19:34:03 | 18:33:14 | | `月出` | 00:13:02 | 20:13:13 | 03:35:37 | | `月中` | 06:55:44 | 13:52:54 | 09:30:08 | | `月落` | 13:38:27 | 07:32:35 | 15:24:39 | | `月相` | 下弦 00:40:14 | 无 | 无 | | `月天数` | 30天 | 30天 | 30天 | | `大月否` | 是 | 是 | 是 | | `闰月否` | 否 | 否 | 否 | | `闰年否` | 否 | 是 | 否 | | `星座` | 天蝎座 | 狮子座 | 摩羯座 | | `下一节气` | 2018-11-07 19:31:39 立冬 | 1995-08-23 22:34:50 处暑 | 1-01-06 20:41:46 小寒 | | `春分` | 2018-03-21 00:15:24 | 1995-03-21 10:14:27 | 1-03-23 05:43:49 | | `夏至` | 2018-06-21 18:07:12 | 1995-06-22 04:34:22 | 1-06-25 04:53:32 | | `秋分` | 2018-09-23 09:54:01 | 1995-09-23 20:13:00 | 1-09-25 15:39:49 | | `冬至` | 2018-12-22 06:22:38 | 1995-12-22 16:16:47 | 1-12-23 08:19:28 | ### 应用示例 <div align="center"> <img src="https://almanac.huangdayu.cn/doc/image/ezgif.com-video-to-gif-1.gif" height="450px" width="250px" alt="设置日期" > <img src="https://almanac.huangdayu.cn/doc/image/ezgif.com-video-to-gif-2.gif" height="450px" width="250px" alt="设置时间" > <img src="https://almanac.huangdayu.cn/doc/image/ezgif.com-video-to-gif-3.gif" height="450px" width="250px" alt="设置位置" > </div> ### 应用下载 - [点击下载](https://almanac.huangdayu.cn/doc/app/AlmanacApp-0.0.3.apk) ### 应用源码 - [AlmanacAPP](https://github.com/HuangDayu/AlmanacApp) ### 不足之处 - 算法并不完全准确,个别数据精度不高,与寿星寿星天文历算法有差异,可能相差十几秒。 - 天文历信息不足,如缺失方位、赤纬、时角、黄经、黄纬、潮汐、太阳高度角、地球直射位置、地球远日点、地球近日点、日食月食等。 ## 相关文档 ### 参考文献(核心算法来源) - [寿星天文历Java封装整理版](https://blog.csdn.net/wangpeng047/article/details/38559591) - [寿星万年历---java算法实现-csdn](https://blog.csdn.net/lxslove/article/details/6083396) - [寿星万年历---java算法实现-cnblogs](http://www.cnblogs.com/moodlxs/archive/2010/12/18/2345392.html) - [根据经纬度计算日出、日落、中天、天亮、天黑和昼长时间](http://www.cnblogs.com/hanoi/archive/2012/07/04/2576325.html) - [日历相关的算法](https://fancyerii.github.io/2019/03/27/calendar/) ### 相关开源 - [寿星天文历 sxwnl](https://github.com/sxwnl/sxwnl) (寿星天文历(万年历)5.10 原版源码) - [lunar-java](https://github.com/6tail/lunar-java) (非常推荐,作者支持了多种语言) - [ChineseCalendar](https://github.com/ytliu0/ChineseCalendar) (公历与农历之间的转换工具 ) ### 在线工具 - [寿星天文历](https://sx.qaiu.top/) - [日历计算器](https://ytliu0.github.io/ChineseCalendar/Julian_simp.html) ### 日历文献 - [黄帝纪年](https://baike.baidu.com/item/%E9%BB%84%E5%B8%9D%E7%BA%AA%E5%B9%B4) - [黄帝历](https://baike.baidu.com/item/%E9%BB%84%E5%B8%9D%E5%8E%86) - [古六历](https://baike.baidu.com/item/%E5%8F%A4%E5%85%AD%E5%8E%86) - [寿星天文历](http://www.nongli.net/sxwnl/) - [日梭万年历](http://www.nongli114.com/rili/2017.html) - [紫金天文台](http://www.pmo.ac.cn/) - [中华农历网](http://www.nongli.net/) - [时间科普](http://www.time.ac.cn/serve/down.htm) - [中国科学院国家授时中心](http://www.ntsc.ac.cn/) - [中国科学院紫金天文台](http://almanac.pmo.ac.cn/) - [电子天文历表](http://almanac.pmo.ac.cn/dianzili.htm) - [天之文](http://www.astron.ac.cn/index.htm) ## License ```license Copyright 2017-12-4 huangdayu Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ```