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;
}
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;
}