Geeks With Blogs
Fórmulas e Cenas Object Reference Not Set to an Instance of an Object

Sometimes we find some code that... well.... I guess someone must be really REALLY high to write...

 

The WTF way

DateTime.Parse(DateTime.Now.ToShortDateString()).ToString("dd-MM-yyyy")

 

The right way:

 

DateTime.Now.ToString("dd-MM-yyyy")

 

 

 

Posted on Monday, February 22, 2010 4:26 AM Geral , C# , Fun | Back to top


Comments on this post: WTF #2

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Sglima | Powered by: GeeksWithBlogs.net