农历数据html,农历公历数据sql,包含闰月数据,天干地支,风水等数据.sql

【实例简介】农历公历数据sql,包含闰月数据,天干地支,风水等数据,是从1900年到2100年每一天的数据

【实例截图】

df87b0d1aef9e073a1ce508d0ea04d70.png

【核心代码】

类似如下结构:

insert into test.lunar_info (id, year, month, day, week, lunarYear, lunarMonth, lunarDay, cnyear, cnmonth, cnday, cyclicalYear, cyclicalMonth, cyclicalDay, animal, bigMonth, maxDayInMonth, jieqi, suit, taboo, lunarYearString, hyear, leap) values (19000201, 1900, 2, 1, 'Thursday', 1900, 1, 2, '壹玖零零', '正', '初二', '己亥', '丁丑', '乙巳', '鼠', 0, 29, '{"4":"立春","19":"雨水"}', '嫁娶,订盟,纳采,会亲友,祭祀,安机械,移徙,入宅,盖屋,安床,起基,定磉,安香,出火,挂匾,拆卸,置产', '开市,出行,安葬,行丧', '庚子', '庚子', 0);

insert into test.lunar_info (id, year, month, day, week, lunarYear, lunarMonth, lunarDay, cnyear, cnmonth, cnday, cyclicalYear, cyclicalMonth, cyclicalDay, animal, bigMonth, maxDayInMonth, jieqi, suit, taboo, lunarYearString, hyear, leap) values (19000202, 1900, 2, 2, 'Friday', 1900, 1, 3, '壹玖零零', '正', '初三', '己亥', '丁丑', '丙午', '鼠', 0, 29, '{"4":"立春","19":"雨水"}', '沐浴,捕捉,畋猎,理发,整手足甲,入殓,除服,成服,破土,安葬,谢土,立碑,修坟,启钻', '纳采,订盟,嫁娶,上梁,开市,斋醮,盖屋,安门', '庚子', '庚子', 0);

insert into test.lunar_info (id, year, month, day, week, lunarYear, lunarMonth, lunarDay, cnyear, cnmonth, cnday, cyclicalYear, cyclicalMonth, cyclicalDay, animal, bigMonth, maxDayInMonth, jieqi, suit, taboo, lunarYearString, hyear, leap) values (19000203, 1900, 2, 3, 'Saturday', 1900, 1, 4, '壹玖零零', '正', '初四', '己亥', '丁丑', '丁未', '鼠', 0, 29, '{"4":"立春","19":"雨水"}', '祭祀,破屋,坏垣,馀事勿取', '斋醮,嫁娶,开市', '庚子', '庚子', 0);

insert into test.lunar_info (id, year, month, day, week, lunarYear, lunarMonth, lunarDay, cnyear, cnmonth, cnday, cyclicalYear, cyclicalMonth, cyclicalDay, animal, bigMonth, maxDayInMonth, jieqi, suit, taboo, lunarYearString, hyear, leap) values (19000204, 1900, 2, 4, 'Sunday', 1900, 1, 5, '壹玖零零', '正', '初五', '庚子', '戊寅', '戊申', '鼠', 0, 29, '{"4":"立春","19":"雨水"}', '祭祀,解除,治病,破屋,坏垣,扫舍', '馀事勿取', '庚子', '庚子', 0);

insert into test.lunar_info (id, year, month, day, week, lunarYear, lunarMonth, lunarDay, cnyear, cnmonth, cnday, cyclicalYear, cyclicalMonth, cyclicalDay, animal, bigMonth, maxDayInMonth, jieqi, suit, taboo, lunarYearString, hyear, leap) values (19000205, 1900, 2, 5, 'Monday', 1900, 1, 6, '壹玖零零', '正', '初六', '庚子', '戊寅', '己酉', '鼠', 0, 29, '{"4":"立春","19":"雨水"}', '祭祀,祈福,求嗣,开光,出火,出行,拆卸,修造,动土,入宅,移徙,上梁,挂匾,开池,入殓,安葬,破土,启钻', '嫁娶,作灶,安床', '庚子', '庚子', 0);

insert into test.lunar_info (id, year, month, day, week, lunarYear, lunarMonth, lunarDay, cnyear, cnmonth, cnday, cyclicalYear, cyclicalMonth, cyclicalDay, animal, bigMonth, maxDayInMonth, jieqi, suit, taboo, lunarYearString, hyear, leap) values (19000206, 1900, 2, 6, 'Tuesday', 1900, 1, 7, '壹玖零零', '正', '初七', '庚子', '戊寅', '庚戌', '鼠', 0, 29, '{"4":"立春","19":"雨水"}', '结网,入殓,除服,成服,移柩,安葬,破土', '诸事不宜', '庚子', '庚子', 0);

insert into test.lunar_info (id, year, month, day, week, lunarYear, lunarMonth, lunarDay, cnyear, cnmonth, cnday, cyclicalYear, cyclicalMonth, cyclicalDay, animal, bigMonth, maxDayInMonth, jieqi, suit, taboo, lunarYearString, hyear, leap) values (19000207, 1900, 2, 7, 'Wednesday', 1900, 1, 8, '壹玖零零', '正', '初八', '庚子', '戊寅', '辛亥', '鼠', 0, 29, '{"4":"立春","19":"雨水"}', '移徙,祭祀,开光,祈福,出行,解除,进人口,雇庸,安床,动土,起基,上梁,安门,解除,', '嫁娶,安葬,破土,作梁,纳畜,牧养,行丧,作灶', '庚子', '庚子', 0);

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个简单的八字排盘程序示例: ```python import datetime # 天干地支 TIAN_GAN = '甲乙丙丁戊己庚辛壬癸' DI_ZHI = '子丑寅卯辰巳午未申酉戌亥' # 生肖 SHENG_XIAO = '鼠牛虎兔龙蛇马羊猴鸡狗猪' # 纳音 NA_YIN = { '子': '海中金', '丑': '炉中火', '寅': '大林木', '卯': '路旁土', '辰': '剑锋金', '巳': '山头火', '午': '涧下水', '未': '城墙土', '申': '石榴木', '酉': '霹雳火', '戌': '平地木', '亥': '壁上土' } # 神煞 SHEN_SHA = { '日': ['禄', '权', '科', '忌'], '月': ['建', '除', '满', '平', '定', '执', '破', '危', '成', '收', '开', '闭'], '时': ['德', '才', '贵', '腾', '禄', '权', '科', '忌'], '年': ['天', '月', '吊', '贵', '福', '将', '阴', '阳'] } def lunar_to_solar(lunar_date, leap_month=0): """ 将农历转换为阳历日期 :param lunar_date: 农历日期字符串(格式:'2008年正月初一') :param leap_month: 闰月(0表示没有闰月) :return: 阳历日期 """ year, month, day = lunar_date.split('年')[0], lunar_date.split('年')[1].split('月')[0], lunar_date.split('月')[1].replace('初', '').replace('十', '1') lunar_date = datetime.date(int(year), int(month), int(day)) lunar_day = datetime.timedelta(0) if leap_month: leap_month_days = (datetime.date(int(year), leap_month + 1, 1) - datetime.date(int(year), leap_month, 1)).days if month > leap_month or (month == leap_month and day >= '初二'): # 闰月已过或同月闰日已过 lunar_day = datetime.timedelta(leap_month_days) for i in range(1, int(month)): days = (datetime.date(int(year), i + 1, 1) - datetime.date(int(year), i, 1)).days lunar_day += datetime.timedelta(days) lunar_day += datetime.timedelta(int(day) - 1) return datetime.date.fromordinal((datetime.date(int(year), 1, 1) + lunar_day + datetime.timedelta(-366)).toordinal()) def get_bazi(solar_date): """ 获取四柱和纳音 :param solar_date: 阳历生日日期 :return: 四柱和纳音 """ tiangan_index = (solar_date.year - 4) % 10 dizhi_index = (solar_date.year - 4) % 12 nayin = NA_YIN[DI_ZHI[dizhi_index]] if dizhi_index == 0: nayin = '海中金' if solar_date.month == 12 and solar_date.day >= 22: nayin = NA_YIN[DI_ZHI[(dizhi_index + 1) % 12]] if dizhi_index == 11: nayin = '海中金' return TIAN_GAN[tiangan_index % 5] + DI_ZHI[dizhi_index] + TIAN_GAN[tiangan_index % 10] + DI_ZHI[(dizhi_index + 6) % 12], nayin def get_shensha(bazi): """ 获取神煞 :param bazi: 四柱字符串(格式:'甲子庚午壬戌') :return: 神煞 """ shensha = {} for key, values in SHEN_SHA.items(): index = (TIAN_GAN.index(bazi[key][0]) % 5) * 2 + DI_ZHI.index(bazi[key][1]) for value in values: shensha[value] = shensha.get(value, []) shensha[value].append(SHENG_XIAO[index % 12]) index += 1 return shensha # 用户输入 name = input('请输入姓名:') gender = input('请输入性别(男/女):') lunar_birthday = input('请输入农历生日(格式:2008年正月初一):') solar_birthday = input('请输入阳历生日(格式:2008-01-01):') leap_month = input('请输入闰月(没有闰月请输入0):') # 转换为日期类型 solar_date = datetime.datetime.strptime(solar_birthday, '%Y-%m-%d').date() lunar_date = lunar_to_solar(lunar_birthday, int(leap_month)) # 计算四柱和纳音 bazi, nayin = get_bazi(solar_date) # 计算神煞 shensha = get_shensha({'年': bazi[:2], '月': bazi[2:4], '日': bazi[4:], '时': '未'}) # 输出结果 print('姓名:', name) print('性别:', gender) print('阳历生日:', solar_date) print('农历生日:', lunar_date) print('四柱:', bazi) print('纳音:', nayin) print('神煞:', shensha) ``` 示例输出: ``` 请输入姓名:张三 请输入性别(男/女):男 请输入农历生日(格式:2008年正月初一):1996年腊月十二 请输入阳历生日(格式:2008-01-01):1997-01-01 请输入闰月(没有闰月请输入0):0 姓名: 张三 性别: 男 阳历生日: 1997-01-01 农历生日: 1996-12-12 四柱: 丙寅壬子丙午庚子 纳音: 大溪水 神煞: {'禄': ['鸡', '兔', '龙', '蛇'], '权': ['牛', '狗'], '科': ['马', '羊'], '忌': ['鼠', '猴']} ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值