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;
            }
  • 相关阅读:
    vue.js 源代码学习笔记 ----- html-parse.js
    vue.js 源代码学习笔记 ----- text-parse.js
    vue.js 源代码学习笔记 ----- keep-alives
    一些图片剪切组件.
    好听的粤语歌..
    jQuery框架Ajax常用选项
    form自动提交
    .NET EF 框架-实现增删改查
    简单抓取小程序大全,并展示
    C#关于调用微信接口的代码
  • 原文地址:https://www.cnblogs.com/deep-blue/p/5109965.html
Copyright © 2011-2022 走看看