Class LunarInfo

java.lang.Object
org.miaixz.bus.core.center.date.chinese.LunarInfo

public class LunarInfo extends Object
阴历(农历)信息
Since:
Java 17+
Author:
Kimi Liu
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
    1900-01-31,农历正月初一
    static final int
    1900年
    static final int
    支持的最大年限
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    leapDays(int y)
    传回农历 y年闰月的天数,如果本年无闰月,返回0,区分大小月
    static int
    leapMonth(int y)
    传回农历 y年闰哪个月 1-12 , 没闰传回 0 此方法会返回润N月中的N,如二月、闰二月都返回2
    static int
    monthDays(int y, int m)
    传回农历 y年m月的总天数,区分大小月
    static int
    yearDays(int y)
    传回农历 y年的总天数

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • BASE_YEAR

      public static final int BASE_YEAR
      1900年
      See Also:
    • BASE_DAY

      public static final long BASE_DAY
      1900-01-31,农历正月初一
    • MAX_YEAR

      public static final int MAX_YEAR
      支持的最大年限
  • Constructor Details

    • LunarInfo

      public LunarInfo()
  • Method Details

    • yearDays

      public static int yearDays(int y)
      传回农历 y年的总天数
      Parameters:
      y - 年
      Returns:
      总天数
    • leapDays

      public static int leapDays(int y)
      传回农历 y年闰月的天数,如果本年无闰月,返回0,区分大小月
      Parameters:
      y - 农历年
      Returns:
      闰月的天数
    • monthDays

      public static int monthDays(int y, int m)
      传回农历 y年m月的总天数,区分大小月
      Parameters:
      y - 年
      m - 月
      Returns:
      总天数
    • leapMonth

      public static int leapMonth(int y)
      传回农历 y年闰哪个月 1-12 , 没闰传回 0 此方法会返回润N月中的N,如二月、闰二月都返回2
      Parameters:
      y - 年
      Returns:
      润的月, 没闰传回 0