Skip to content

Convert Chinese Lunar calendar date to and back from Gregorian calendar date between 1901-2100

License

Notifications You must be signed in to change notification settings

CrazyOrr/lunar-calendar

Repository files navigation

lunar-calendar

English | 简体中文

Convert Chinese Lunar calendar date to and back from Gregorian calendar date between 1901-2100.

The Chinese Lunar calendar data is obtained from Hong Kong Observatory

Usage

lunar-calendar.sqlite contains a table gregorian_lunar which contains the relationship of Gregorian calendar date to Chinese Lunar calendar date for every single day between 1901-2100 scraped from Hong Kong Observatory by lunar_calendar.py

  • Lookup Gregorian date by Chinese Lunar date
SELECT gregorian_date FROM gregorian_lunar WHERE lunar_cycle = 1 AND lunar_year_of_cycle = 37 AND lunar_month_of_year = 10 AND lunar_day_of_month = 20;
  • Lookup Chinese Lunar date by Gregorian date
SELECT lunar_cycle, lunar_year_of_cycle, lunar_month_of_year, lunar_day_of_month, lunar_solar_term FROM gregorian_lunar WHERE gregorian_date = '2020-07-06';
SELECT lunar_cycle, lunar_year_of_cycle, lunar_year_of_cycle_name, lunar_month_of_year, lunar_month_of_year_name, lunar_day_of_month, lunar_day_of_month_name, lunar_solar_term, lunar_solar_term_name FROM gregorian_lunar_view WHERE gregorian_date = '2020-07-06';

lunar-calendar.sqbpro is a SQLite project file which contains demo usages.

Credits

License

See LICENSE

About

Convert Chinese Lunar calendar date to and back from Gregorian calendar date between 1901-2100

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages