Ara :
HOME
ASP
PHP
JAVASCRIPT
C#
Add Code
Turkish
ASP Code Samples
PHP Code Samples
JavaScript Code Samples
C# Code Samples
C# Code Sample
C# Custom DateTime Formatting
Following examples demonstrate how are the format specifiers rewritten to the output.
DateTime dt = new DateTime(2010, 4, 21); String.Format("{0:M/d/yyyy}", dt); // "4/21/2010" String.Format("{0:MM/dd/yyyy}", dt); // "04/21/2010" String.Format("{0: MMM d, yyyy}", dt); // Apr 21, 2010" String.Format("{0: MMMM d, yyyy}", dt); // Apr 21, 2010"
There are following custom format specifiers y (year), M (month), d (day), h (hour 12), H (hour 24), m (minute), s (second), f (second fraction), F (second fraction, trailing zeroes are trimmed), t (P.M or A.M) and z (time zone).
Added By : Administrator
Back to C# Code Samples
email :
info@kodornekleri.com