/// 求儒略日
    /// </summary>
    /// <param name="year"></param>
    /// <param name="month"></param>
    /// <param name="day"></param>
    /// <param name="hour"></param>
    /// <param name="min"></param>
    /// <param name="sec"></param>
    /// <returns></returns>
    public static double JD_cal(int year, int month, int day, int hour, int min, int sec)
    {
        double J0 = 367 * year - Mathf.FloorToInt(7 * (year + Mathf.FloorToInt((float)(month + 9) / 12)) / 4) + Mathf.FloorToInt(275 * (float)month / 9) + day + 1721013.5f;
        Debug.Log("J0 = " + J0);
        double UT = hour + (double)min / 60 + (double)sec / 3600;
        Debug.Log("UT = " + UT);
        return J0 + UT / 24;
    }

标签: none

添加新评论