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

Date Format Directory

Today, we discussed Date Format Directory in C#.Net

Code:
public static void CreateDirectory(string DesignationPath) { if (!Directory.Exists(DesignationPath)) { Directory.CreateDirectory(DesignationPath); } } public static string currentYear() { string Year = string.Empty; DateTime dt = DateTime.Now; string format = "yyyy"; Year = dt.ToString(format); return Year; } public static string currentMonth() { string Month = string.Empty; DateTime dt = DateTime.Now; string format = "MM"; Month = dt.ToString(format); return Month; } public static string currentDate() { string day = string.Empty; DateTime dt = DateTime.Now; string format = "dd"; day = dt.ToString(format); return day; }