Thursday, May 8, 2008

Different Date Format in C#

DateTime sai = DateTime.Now; //Get Date and Time


Console.WriteLine("d format: {0:d}", sai);
Console.WriteLine("D format: {0:D}", sai);

Console.WriteLine("t format: {0:t}", sai);

Console.WriteLine("T format: {0:T}", sai);

Console.WriteLine("f format: {0:f}", sai);

Console.WriteLine("F format: {0:F}", sai);

Console.WriteLine("g format: {0:g}", sai);

Console.WriteLine("G format: {0:G}", sai);

Console.WriteLine("m format: {0:m}", sai);

Console.WriteLine("M format: {0:M}", sai);

Console.WriteLine("r format: {0:r}", sai);

Console.WriteLine("R format: {0:R}", sai);

Console.WriteLine("s format: {0:s}", sai);

Console.WriteLine("u format: {0:u}", sai);

Console.WriteLine("U format: {0:U}", sai);

Console.WriteLine("y format: {0:y}", sai);

Console.WriteLine("Y format: {0:Y}", sai);

Console.Read();





1 comment:

jorgeefrrr828 said...

Can I just say what a aid to find somebody who truly is aware of what theyre speaking about on the internet. You undoubtedly know how one can carry a problem to gentle and make it important. More folks need to read this and understand this facet of the story. I cant consider youre not more well-liked because you undoubtedly have the gift. online casino games