Strings En .Net
Specifier d D f F g G Name Short date pattern Long date pattern Full date/time pattern (short time) Full date/time pattern (long time) General date/time pattern (short time) General date/time pattern (long time) Month day pattern Round-trip date/time pattern RFC1123 pattern Sortable date/time pattern; ISO 8601 Short time pattern Long time pattern Universalsortable date/time pattern Universal sortable date/time pattern Year month pattern (Unknown specifier) Description Represents a custom DateTime format string defined by the current ShortDatePattern property. Represents a custom DateTime format string defined by the current LongDatePattern property. Represents a combination of the long date (D) and short time (t) patterns, separated by a space.Represents a custom DateTime format string defined by the current FullDateTimePattern property. Represents a combination of the short date (d) and short time (t) patterns, separated by a space. Represents a combination of the short date (d) and long time (T) patterns, separated by a space. Represents a custom DateTime format string defined by the current MonthDayPattern property. Represents a customDateTime format string using a pattern that preserves time zone information. The pattern is designed to round-trip DateTime formats, including the Kind property, in text. Then the formatted string can be parsed back using Parse or ParseExact with the correct Kind property value. Equivalent custom format string is "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK". Represents a custom DateTime format stringdefined by the current RFC1123Pattern property. The pattern is a defined standard and the property is readonly. Equivalent custom format string is "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'". Does not convert DateTimes to UTC. Represents a custom DateTime format string defined by the current SortableDateTimePattern property. This pattern is a defined standard and the property is read-only. Equivalentcustom format string is "yyyy'-'MM'-'dd'T'HH':'mm':'ss". Represents a custom DateTime format string defined by the current ShortTimePattern property. For example, the custom format string for the invariant culture is "HH:mm". Represents a custom DateTime format string defined by the current LongTimePattern property. For example, the custom format string for the invariant culture is "HH:mm:ss".Represents a custom DateTime format string defined by the current UniversalSortableDateTimePattern property. Equivalent custom format string is "yyyy'-'MM'-'dd HH':'mm':'ss'Z'". Does not convert DateTimes to UTC. Represents a custom DateTime format string defined by the current FullDateTimePattern property. This pattern is the same as the full date/long time (F) pattern. However, formatting operates onthe Coordinated Universal Time (UTC) that is equivalent to the DateTime object being formatted. Represents a custom DateTime format string defined by the current YearMonthPattern property. For example, the custom format string for the invariant culture is "yyyy MMMM". An unknown specifier throws a runtime format exception.
M or m o
R or r s t T u U
Y or y Any other single characterMore .NET Cheat Sheets available at http://john-sheehan.com/blog/
.NET Custom DateTime Format Strings
Specifier d dd ddd dddd f Description Represents the day of the month as a number from 1 through 31. A single-digit day is formatted without a leading zero. Represents the day of the month as a number from 01 through 31. A single-digit day is formatted with a leading zero. Represents theabbreviated name of the day of the week as defined in the current System.Globalization.DateTimeFormatInfo.AbbreviatedDayNames property. Represents the full name of the day of the week as defined in the current System.Globalization.DateTimeFormatInfo.DayNames property. Represents the most significant digit of the seconds fraction. Note that if the "f" format specifier is used alone, without other format...
Regístrate para leer el documento completo.