• python阳历转农历


        # 引入日历库模块
        import sxtwl
        # 日历中文索引
        ymc = ["十一", "腊", "正", "二", "三", "四", "五", "六", "七", "八", "九", "十"]
        rmc = ["初一", "初二", "初三", "初四", "初五", "初六", "初七", "初八", "初九", "初十", "十一", "十二", "十三", "十四", "十五", "十六", "十七", "十八","十九", "二十", "廿一", "廿二", "廿三", "廿四", "廿五", "廿六", "廿七", "廿八", "廿九", "三十", "卅一"]
        # 实例化日历库
        lunar = sxtwl.Lunar()
        # 通过阳历获取查询日期信息
        day = lunar.getDayBySolar(1996, 1, 8)
        print(u"公历:", day.y, u"年", day.m, u"月", day.d, u"日")
        if day.Lleap:
            print( u"阴历:润", ymc[day.Lmc], u"月", rmc[day.Ldi], u"日")
        else:
            print(u"阴历:", ymc[day.Lmc], u"月", rmc[day.Ldi], u"日")
    
    
  • 相关阅读:
    HDU-6315 Naive Operations 线段树
    18牛客第二场 J farm
    POJ
    SPOJ
    codeforces 501C. Misha and Forest
    Codeforces 584C
    Domination
    HDU-3074 Multiply game
    Codefoeces-689D Friends and Subsequences
    Codeforces Round #486 (Div. 3)
  • 原文地址:https://www.cnblogs.com/jiangwenwen1/p/10261238.html
Copyright © 2020-2023  润新知