Class Zodiac

java.lang.Object
org.miaixz.bus.core.center.date.Zodiac

public class Zodiac extends Object
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • Zodiac

      public Zodiac()
  • Method Details

    • getZodiac

      public static String getZodiac(Date date)
      通过生日计算星座
      Parameters:
      date - 出生日期
      Returns:
      星座名
    • getZodiac

      public static String getZodiac(Calendar calendar)
      通过生日计算星座
      Parameters:
      calendar - 出生日期
      Returns:
      星座名
    • getZodiac

      public static String getZodiac(Fields.Month month, int day)
      通过生日计算星座
      Parameters:
      month - 月,从0开始计数
      day - 天
      Returns:
      星座名
    • getZodiac

      public static String getZodiac(int month, int day)
      通过生日计算星座
      Parameters:
      month - 月,从0开始计数,见Fields.Month.getValue()
      day - 天
      Returns:
      星座名
    • getChineseZodiac

      public static String getChineseZodiac(Date date)
      通过生日计算生肖,只计算1900年后出生的人
      Parameters:
      date - 出生日期(年需农历)
      Returns:
      星座名
    • getChineseZodiac

      public static String getChineseZodiac(Calendar calendar)
      通过生日计算生肖,只计算1900年后出生的人
      Parameters:
      calendar - 出生日期(年需农历)
      Returns:
      星座名
    • getChineseZodiac

      public static String getChineseZodiac(int year)
      计算生肖,只计算1900年后出生的人
      Parameters:
      year - 农历年
      Returns:
      生肖名