zoukankan      html  css  js  c++  java
  • 生日转换成星座

     
             /// <summary>
            /// 生日转换成星座
            /// </summary>
            /// <param name="birthday"></param>
            /// <returns></returns>
            public static string GetAstro(DateTime birthday)
            {
                string value = string.Empty;
                int month = birthday.Month;
                int day = birthday.Day;
                if (month == 1 && day >= 20 || month == 2 && day <= 18) { value = "水瓶座"; }
                if (month == 2 && day >= 19 || month == 3 && day <= 20) { value = "双鱼座"; }
                if (month == 3 && day >= 21 || month == 4 && day <= 19) { value = "白羊座"; }
                if (month == 4 && day >= 20 || month == 5 && day <= 20) { value = "金牛座"; }
                if (month == 5 && day >= 21 || month == 6 && day <= 21) { value = "双子座"; }
                if (month == 6 && day >= 22 || month == 7 && day <= 22) { value = "巨蟹座"; }
                if (month == 7 && day >= 23 || month == 8 && day <= 22) { value = "狮子座"; }
                if (month == 8 && day >= 23 || month == 9 && day <= 22) { value = "室女座"; }
                if (month == 9 && day >= 23 || month == 10 && day <= 22) { value = "天秤座"; }
                if (month == 10 && day >= 23 || month == 11 && day <= 21) { value = "天蝎座"; }
                if (month == 11 && day >= 22 || month == 12 && day <= 21) { value = "人马座"; }
                if (month == 12 && day >= 22 || month == 1 && day <= 19) { value = "摩羯座"; }
                return value;
            }
  • 相关阅读:
    android background属性问题
    AlertDialog 设置不同按钮的样式
    springboot controller统一异常处理
    springboot 配置自定义拦截器
    Linux中proc信息获取
    AliCloud-tools【分享】
    sql列转行
    算法
    静态变量与代码块
    AbstractQueuedSynchronizer(AQS)
  • 原文地址:https://www.cnblogs.com/deep-blue/p/5109965.html
Copyright © 2011-2022 走看看