h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

Split date from DateTime in C#.Net

private static string CurrentDate;
       
        public  static string SplitDay(DateTime dtp,string Mode)
        {
            string str = Convert.ToString(dtp);
            String.Format("{0:MM/dd/yyyy}", dtp);
            string[] st = str.Split('/');
            switch (Mode)
            {
                case "Day":
                    CurrentDate = st[1];
                    break;
                case "Month":
                    CurrentDate = st[0];
                    break;
                case "Year":
                    CurrentDate = st[2];
                    string[] s = CurrentDate.Split(' ');
                    CurrentDate = s[0];
                    break;
            }
            return CurrentDate;
        }