17
1
using System;
2
3
public class Program
4
{
5
public static void Main()
6
{
7
var dt = DateTime.Now;
8
9
Console.WriteLine("Date String Current Culture: " + dt.ToString("d"));
10
Console.WriteLine("MM/dd/yyyy Format: " + dt.ToString("MM/dd/yyyy"));
11
Console.WriteLine("dddd, dd MMMM yyyy Format: " + dt.ToString("dddd, dd MMMM yyyy"));
12
Console.WriteLine("MM/dd/yyyy h:mm tt Format: " + dt.ToString("MM/dd/yyyy h:mm tt"));
13
Console.WriteLine("MMMM dd Format:" + dt.ToString("MMMM dd"));
14
Console.WriteLine("HH:mm:ss Format: " + dt.ToString("HH:mm:ss"));
15
Console.WriteLine("hh:mm tt Format: " + dt.ToString("hh:mm tt"));
16
}
17
}
Cached Result
Enter number of elements:
>