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



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.

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.


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.

Jorge Frew 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