Exemplo n.º 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]);
 }
Exemplo n.º 2
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, ":"));
        }