code_junkie

What's the simplest way to format a .NET DateTime according to YYYYMMDD or the like?

Nov 13th, 2011
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.12 KB | None | 0 0
  1. string s = DateTime.Today.ToString("yyyyMMdd");
  2.  
  3. myDateTime.ToString("yyyyMMdd")
  4.  
  5. DateTime.Now.ToString("yyyyMMdd");
Add Comment
Please, Sign In to add comment