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();





3 comments:

joy said...

I am so glad to be given a chance to read your wonderful article. Im looking forward to read more of your works and posts. You did a good job! Try to visit my site too and enjoy.

n8fan.net

www.n8fan.net

Leslie Lim said...

I admired those who has able to create a blog as wonderful as this! You are truly a hard working person. Keep up the good work and keep on posting.

Say
www.imarksweb.org

lee woo said...

I really enjoyed reading your article. I found this as an informative and interesting post, so i think it is very useful and knowledgeable. I would like to thank you for the effort you have made in writing this article.


edupdf.org