看得破的人,处处都是生机;

看不破的人,处处都是困境;

拿得起的人,处处都是担当;

拿不起的人,处处都是疏忽;

放得下的人,处处都是大道;

放不下的人,处处都是迷茫;

想得开的人,处处都是春天;

想不开的人,处处都是凋枯;

做何人,在自己;

小自我,大天地;

c# 算节气

    public static string ChineseTwentyFourDay(DateTime date1)
    {
        string[] SolarTerm = new string[] { "小寒", "大寒", "立春", "雨水", "惊蛰", "春分", "清明", "谷雨", "立夏", "小满", "芒种", "夏至", "小暑", "大暑", "立秋", "处暑", "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至" };
        int[] sTermInfo = new int[] { 0, 21208, 42467, 63836, 85337, 107014, 128867, 150921, 173149, 195551, 218072, 240693, 263343, 285989, 308563, 331033, 353350, 375494, 397447, 419210, 440795, 462224, 483532, 504758 };
        DateTime baseDateAndTime = new DateTime(1900, 1, 6, 2, 5, 0); //#1/6/1900 2:05:00 AM#
        DateTime newDate;
        double num;
        int y;
        string tempStr = "";

        y = date1.Year;

        for (int i = 1; i <= 24; i++)
        {
            num = 525948.76 * (y - 1900) + sTermInfo[i - 1];

            newDate = baseDateAndTime.AddMinutes(num);//按分钟计算
            if (newDate.DayOfYear == date1.DayOfYear)
            {
                tempStr = SolarTerm[i - 1];
                break;
            }
        }
        return tempStr;
    }





protected void Page_Load(object sender, EventArgs e)
    {
        DateTime dt = new DateTime(2013, 1, 6, 2, 5, 0); //#1/6/1900 2:05:00 AM#
        string jq = ChineseTwentyFourDay(dt);
        Response.Write("节气:" + jq);
    }

 

posted @ 2013-01-21 11:43  心电心  阅读(1344)  评论(0编辑  收藏  举报