Пример #1
0
 public static string NextSession(string session)
 {
     string[] newSession = session.Split('/');
     newSession[0] = (AppHandler.ToInt(newSession[0]) + 1).ToString();
     newSession[1] = (AppHandler.ToInt(newSession[1]) + 1).ToString();
     return(newSession[0] + "/" + newSession[1]);
 }
Пример #2
0
        public static DateTime GetRetirementDate(DateTime birthdate, DateTime firstAppDate)
        {
            int      yr    = birthdate.Year;
            int      age   = AppHandler.GetAge(birthdate);
            int      rYear = (60 - age) + DateTime.Now.Year;
            DateTime dt    = new DateTime(firstAppDate.Year + 35, firstAppDate.Month, firstAppDate.Day);

            if (dt.Year - birthdate.Year <= 60)
            {
                return(dt);
            }
            return(new DateTime(rYear, birthdate.Month, birthdate.Day));
        }
Пример #3
0
        public static string ToMySqlTime(DateTime dt)
        {
            string ampm = dt.ToLongTimeString().Contains("PM") ? "PM" : "AM";

            string[] strTime = dt.ToLongTimeString().Split(' ')[0].Split(':');
            int      hr      = AppHandler.ToInt(strTime[0]);

            if (hr < 10 && ampm == "AM")
            {
                return("0" + Implode(strTime, ":"));
            }
            else if (hr < 10 && ampm == "PM")
            {
                return((12 + hr) + ":" + strTime[1] + ":" + strTime[2]);
            }
            else if (hr == 12 && ampm == "PM")
            {
                return("00:" + strTime[1] + ":" + strTime[2]);
            }
            return(Implode(strTime, ":"));
        }