console will produce the output as shown below. 1:LONGDATEPATTERN:DDDD, MMMM D, yyyy 2:LONGTIMEPATTERN:H:MM:SS TT 3:shortdatepattern:m/d/yyyy 4:SHORTTIMEPATTERN:H:MM TTThird, read the structured configurationMost of the configurations involved in a real project have a structured hierarchy, so the configuration object has the same structure. Structured co
", if the format is set to {0:n1}, then the loss
Out as "1.5". Its commonly used numerical formats are shown in the following table:
format string input result
' {0:c} ' 12345.6789 $12,345.68' {0:c} '-12345.6789 ($12,345.68)"{0:d}" 12345 12345"{0:d8}" 12345 00012345' {0:e} ' 12345.6789 1234568E+004' {0:e10} ' 12345.6789 1.2345678900E+004"{0:f}" 12345.6789 12345.68"{0:f0}" 12345.6789 12346"{0:g}" 12345.6789 12345.6789' {0:g7} ' 123456789 1.234568E8' {0:n} ' 12345.6789 12,345.68' {0:n4} ' 12345
method of the limit parameter and the final execution result are as follows,
The following uses the cwj birthday of android123 as an example:
"Mm/DD/yy H: MPAA"-> "11/03/87 am""Mmm DD, yyyy H: MPAA"-> "Nov 3, 1987 am""Mmmm DD, yyyy H: MPAA"-> "November 3, 1987 am""E, Mmmm DD, yyyy
Moment.js Date wrapper class Moment.js1 Create Time ObjectMoment (); Current timeMoment (new Date (2020, 3, 7)); Date Object creationMoment (1318781876406); Time Stamp CreationMoment ("12-25-1995", "mm-dd-yyyy"); Date text + date formatMoment ("12-25-1995", ["mm-dd-yyyy", "YYYY-MM-DD"]);Moment ([year, month, date, hours, minutes, seconds, milliseconds]); Array cr
. ToString ("yyyy");Yy= "2007"
Month
M
5.
String mon = DateTime.Parse ("1984-05-09")ToString("Yyyy-m")Mon = "1984-5"
Mm
05.
String mon = DateTime.Parse ("1984-05-09")ToString("MM")Mon = "05"
MMM
If it is a Chinese version of the operating system, it will be output: May.If i
Oracle and Java date formats
If you want to convert to a 2005-07-05 format, you need to use the class SimpleDateFormat
SimpleDateFormat formatt= New SimpleDateFormat ("Yyyy-mm-dd");Date Date =new date ();System.out.println (Formatt.format (date));
The printed format is: 2005-07-07
SimpleDateFormat formatt= New SimpleDateFormat ("Yyyy-mmmm-dd");Date Date =new date
The case sensitivity of the tostring method of the date object affects the output result. As follows. Incorrect usage :? Convert. todatetime ("2005/12/22 22:22:22"). tostring ("yyyy/mm/dd hh: mm: SS ")
"Yyyy/12/DD 22: 12: SS"
? Convert. todatetime ("2005/12/22 22:22:22"). tostring ("yyyy/mm/dd hh: mm: SS ")
"2005/22/22 10:22:22" correct usage: Convert. todatetime
[m],
Mmmm: i18n. monthNames [m + 12], // Bit Width: 12, see dateFormat. monthNames
Yy: String (y). slice (2), // usage of the String slice ()
Yyyy: y,
H: H % 12 | 12, // h indicates the 12-hour system. h is divided by 12 (because 12 hours). The remainder is in the 12-hour system.
Hh: pad (H % 12 | 12 ),
H: H,
HH: pad (H ),
M: M,
MM: pad (M ),
S: s,
Ss: pad (s ),
L: pad (
: {0: c}" 12345.6789 total: $12345.68 Common Date and Time formats: Format description output format D. Simplified Date Format: mm/DD/YYYY D detailed Date Format: dddd, Mmmm DD, yyyy F full format (long date + short time) dddd, Mmmm DD, yyyy hh: mm F Complete Date and
affect formatting.Standard DateTime format stringFormat specifier name descriptionDShort Date ModeRepresents a custom DateTime format string defined by the current ShortDatePattern property.For example, the custom format string for the invariant culture is "mm/dd/yyyy".DLong Date ModeRepresents a custom DateTime format string defined by the current Longdatepattern property.For example, the custom format string for the invariant culture is "dddd, dd
“;” Characters are used to separate positive, negative, and 0 parts in a format string.OtherAll other charactersAll other characters are copied into the result string and do not affect formatting.Standard DateTime format stringFormat specifier name descriptionDShort Date ModeRepresents a custom DateTime format string defined by the current ShortDatePattern property.For example, the custom format string for the invariant culture is "mm/dd/yyyy".DLong D
string for the invariant culture is "mm/dd/yyyy".DLong Date ModeRepresents a custom DateTime format string defined by the current Longdatepattern property.For example, the custom format string for the invariant culture is "dddd, dd MMMM yyyy".FFull Date/Time mode (short time)Represents a combination of a long date (D) and a short time (t) pattern, separated by a
Asp.net| Date | experience | Conversion date to a string is almost always the work of every project, no matter what development tool you use. Using convert or cast in SQL Server makes it easy to convert dates into strings of various formats, in which a string (date, "Yyyy-mm-dd") can be used in a single step. In the asp.net? I find that always less than I would, if using yyyy-mm-dd this way to convert:
Begi
Conversion date conversion to a string is almost always the work of every project, no matter what development tool you use. Using convert or cast in SQL Server makes it easy to convert dates into strings of various formats, in which a string (date, "Yyyy-mm-dd") can be used in a single step. In the asp.net? I find that always less than I would, if using yyyy-mm-dd this way to convert:
BeginDate.SelectedDate
that we want the data to display; in addition, after the specified format symbol, you can specify the number of digits to be displayed in decimal places. For example, if the original data is "12.34" and the format is set to {0: N1}, the output is "12.3 」. The common numeric format is shown in the following table:
Format String data result"{0: c}" 12345.6789 $12,345.68"{0: c}"-12345.6789 ($12,345.68)"{0: d}" 12345 12345"{0: D8}" 12345 00012345"{0: e}" 12345.6789 1234568e + 004"{0: E10 }" 12345
}" 12345.6789 12346"{0: g}" 12345.6789 12345.6789"{0: G7}" 123456789 1.234568e8"{0: n}" 12345.6789 12,345.68"{0: N4}" 123456789 123,456,789.0000"Total: {0: c}" 12345.6789 total: $12345.68
The commonly used date formats are shown in the following table:
Format description output formatD. Simplified Date Format: mm/DD/YYYYD detailed Date Format: dddd, Mmmm DD, yyyyF full format (long date + short time) dddd, Mmmm
: $12345.68
The commonly used date formats are shown in the following table:
format description output format D simplified Date Format mm/DD/YYYY D detailed Date Format dddd, Mmmm DD, yyyy F full format (long date + short time) dddd, Mmmm DD, yyyy hh: mm F full Date
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.