Last active
October 17, 2015 07:59
-
-
Save TDK1964/1aad020472c450b8d8cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DateTime dt = DateTime.Now; | |
String strDate=""; | |
strDate = dt.ToString("MM/dd/yyyy"); // 07/21/2007 | |
strDate = dt.ToString("dddd, dd MMMM yyyy"); //Saturday, 21 July 2007 | |
strDate = dt.ToString("dddd, dd MMMM yyyy HH:mm"); // Saturday, 21 July 2007 14:58 | |
strDate = dt.ToString("dddd, dd MMMM yyyy hh:mm tt"); // Saturday, 21 July 2007 03:00 PM | |
strDate = dt.ToString("dddd, dd MMMM yyyy H:mm"); // Saturday, 21 July 2007 5:01 | |
strDate = dt.ToString("dddd, dd MMMM yyyy h:mm tt"); // Saturday, 21 July 2007 3:03 PM | |
strDate = dt.ToString("dddd, dd MMMM yyyy HH:mm:ss"); // Saturday, 21 July 2007 15:04:10 | |
strDate = dt.ToString("MM/dd/yyyy HH:mm"); // 07/21/2007 15:05 | |
strDate = dt.ToString("MM/dd/yyyy hh:mm tt"); // 07/21/2007 03:06 PM | |
strDate = dt.ToString("MM/dd/yyyy H:mm"); // 07/21/2007 15:07 | |
strDate = dt.ToString("MM/dd/yyyy h:mm tt"); // 07/21/2007 3:07 PM | |
strDate = dt.ToString("MM/dd/yyyy HH:mm:ss"); // 07/21/2007 15:09:29 | |
strDate = dt.ToString("MMMM dd"); // July 21 | |
strDate = dt.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK"); // 2007-07-21T15:11:19.1250000+05:30 | |
strDate = dt.ToString("ddd, dd MMM yyyy HH':'mm':'ss 'GMT'"); // Sat, 21 Jul 2007 15:12:16 GMT | |
strDate = dt.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss"); // 2007-07-21T15:12:57 | |
strDate = dt.ToString("HH:mm"); // 15:14 | |
strDate = dt.ToString("hh:mm tt"); // 03:14 PM | |
strDate = dt.ToString("H:mm"); // 5:15 | |
strDate = dt.ToString("h:mm tt"); // 3:16 PM | |
strDate = dt.ToString("HH:mm:ss"); // 15:16:29 | |
strDate = dt.ToString("yyyy'-'MM'-'dd HH':'mm':'ss'Z'"); // 2007-07-21 15:17:20Z | |
strDate = dt.ToString("dddd, dd MMMM yyyy HH:mm:ss"); // Saturday, 21 July 2007 15:17:58 | |
strDate = dt.ToString("yyyy MMMM"); // 2007 July |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment