Recommend a calendar conversion open source tool library that supports mainstream languages such as C#, Java, and PHP

For more open source projects, please check: A list focusing on recommending .Net open source projects

For us, the most familiar calendars are the Gregorian calendar and the lunar calendar. In China, there are fixed festivals, solar terms, and unique Chinese traditional festivals every year. Some festivals are fixed, but solar terms require us to convert them through certain rules.

Therefore, today I recommend an open source library to everyone, which supports the calendar conversion of the Gregorian calendar, lunar calendar, Buddhist calendar, and Daoist calendar, which can meet all our needs.

Project Description

This is a multi-language development tool that supports solar calendar, lunar calendar, Buddhist calendar, and Taoist calendar. It also supports constellations, stems and branches, zodiac signs, solar terms, festivals, Peng Zu Baiji, daily taboos, auspicious gods, Bad luck, auspicious god azimuth, Chongsha, nayin, star, horoscope, five elements, ten gods, twelve gods of Jianchu, Qinglong Mingtang, etc., zodiac day and good or bad luck, etc.

This tool has very comprehensive functions and is used for festivals, solar terms reminders, almanac queries, constellation queries, etc.

The tool is available in multiple development languages: javascript, java, c#, php, python, go, typescript, flutter, swift.

tool function

1. Gregorian calendar: Gregorian week, month, quarter, half year, year, leap year, number of days in a year, number of days in a month, etc.;

2. Lunar calendar: solar terms, stems and branches, three volts, zodiac signs, eight trigrams directions, auspicious and god directions, etc.;

3. Buddhist calendar: karmic taboo, moon fasting, Guanyin fasting, Shuowang fasting, etc.;

4. Daoist Calendar: Sanhui Day, Sanyuan Day, Eight Festivals, Wula Day, Bahui Day, Wu Day, etc.

Instructions

How to use C#

using System;
using Lunar;
namespace demo
{
    class Program
    {        
        static void Main(string[] args)
        {
            var solar = new Solar(1986, 5, 29);
           var lunar = solar.Lunar;
           Console.WriteLine(lunar.FullString); 
           Console.WriteLine(solar.FullString);
        }    
    }
}
//输出
一九八六年四月廿一 丙寅(虎)年 癸巳(蛇)月 癸酉(鸡)日 子(鼠)时 纳音[炉中火 长流水 剑锋金 桑柘木] 星期四 北方玄武 星宿[斗木獬](吉) 彭祖百忌[癸不词讼理弱敌强 酉不会客醉坐颠狂] 喜神方位[巽](东南) 阳贵神方位[巽](东南) 阴贵神方位[震](正东) 福神方位[兑](正西) 财神方位[离](正南) 冲[(丁卯)兔] 煞[东]
1986-05-29 00:00:00 星期四 双子座

Calendar example

[External link picture transfer failed, the source site may have an anti-theft link mechanism, it is recommended to save the picture and upload it directly (img-Wd0E6suI-1677899552764)(https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp /3a93b3db66f145aaa63d39a473725634~tplv-k3u1fbpfcp-zoom-1.image)]

Buddhist calendar example

picture

Dao calendar example

picture

almanac example

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-5Wk34yXM-1677899552766)(https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp /0bc3e5daece7413e80169a2a9d8b6623~tplv-k3u1fbpfcp-zoom-1.image)]

project address

Github:

https://github.com/6tail/lunar-csharp

Gitee:

https://gitee.com/6tail/lunar-csharp

- End -

recommended reading

An open source project for B station video download developed by WPF

Recommend a cross-platform operation library that supports more than 30 formats such as Word, Excel, CSV, Email, etc.

A Windows Screenshot Recording Tool Based on .Net

Recommend a .Net distributed microservice development framework

A high-performance cross-platform intranet penetration tool based on .Net

Guess you like

Origin blog.csdn.net/daremeself/article/details/129332119