. For example, if the original data is "1.56" and the format is set to {0: N1}, the output is "1.5 」. The common numeric format is 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
String zonestr timestamp #pragma mark timestamp turns into time-(nsstring *) Timestampintotime: (nsstring *) zonestr{ //timestamp string converted to date stringLong long index = [zonestr longlongvalue]; nsdate *sinedate = [nsdate dateWithTimeIntervalSince1970: index/ ]; nsdateformatter *dateformatter = [[nsdateformatter alloc] init]; //yyyy mm month dd Day HH24 hours HH12 hours mm minutes ss seconds mmmm m
Number, Currency format:After the specified format symbol, you can specify the number of digits to display for the decimal. For example, the original data is "1.56", if the format is set to {0:n1}, then the output is "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"{
Java.text.SimpleDateFormat and its abstract base class Java.text.DateFormat come in handy.II. custom format for date dataIf we want to customize the format of date data, for example Saturday-September-29th-2001. The following example shows how to do the work:Import Java.text.SimpleDateFormat;Import Java.util.Date;public class DateExample2 {public static void Main (string[] args) {SimpleDateFormat Bartdateformat =New SimpleDateFormat ("eeee-mmmm-dd-
a leading zero.
The abbreviated name of the MMM month, defined in AbbreviatedMonthNames.
The full name of the MMMM month, defined in MonthNames.
Y does not contain the year of the era. If the year that does not contain the era is less than 10, the year is displayed with no leading zeros.
YY does not contain years of the era. If the year that does not contain the era is less than 10, the year with leading zeros is displayed.
fractional part of the second. For example, ff is precisely displayed to 1% seconds, while ffff is precisely displayed to one in ten seconds. Up to seven f characters can be used in a user-defined format. If this is a unique character in the User-Defined number format, use % f. T uses the 12-hour format, and displays uppercase A for any hour before noon, and uppercase P for any hour between noon and p.m. If this is a unique character in the User-Defined number format, use % t. Tt uses the 12-ho
following are the referenced contents:Connected. Waiting for response.Serv-u FTP Server v4.0 for WinSock ready ...USER Test530 not logged in, only one (also possibly two or three) session from same IP allowed at a time.QUIT
Each IP can only open one (also may be two or three) download, do not use multithreading, carefully ban you.
The following are the referenced contents: Restart marker reply. In this case, the "text is exact" particular implementation; It must read:mark
separator. When formatting a date value, the date separator can be used to separate the year, month, and day. The real characters of the date separator are determined by the system settings when the format is output.
C uses ddddd to display the date and ttttt to display the time. If the value to be displayed has no decimal part, only the date part is displayed. If the value to be displayed has no integer part, only the time part is displayed.
D
Display the Day (1-31) with no leading zero ).
Dd
Usage:
DataFormatString = "{0: Format String }"
{0} In DataFormatString represents the data itself, while the format string after the colon represents the format they want to display the data;
Number and currency format: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 "1.56" and the format is set to {0: N1 },
Output Value: 1.5 」. The common numeric format is shown in the following table:
Format String
Datetimepicker: Select "cutstom" as the custom time or date display format in datetimepicker, and then write the format string in "cutstomformat". The description is as follows: how to display am, then write it as: hh: mm tt (case sensitive) to display strings or format strings containing Date and Time delimiters, escape characters must be used in substrings. For example, to display the date as "June 06 at PM", set the customformat attribute to "Mmmm
directory.
10. users need to copy the file named rfc1261.txt to the local host and change it to nicinfo.
11. The character port is a standard FTP command to establish a data connection. 200 indicates "the command is correct ".
12. The number 150 indicates that "the File status is correct and a data connection will be established ".
13. The number 226 is "release data connection ". A new local file is generated.
14. Enter the exit command.
15. indicates that FTP is finished.
110 restart marker
separator are determined by the system settings when the format is output.
C uses ddddd to display the date and ttttt to display the time. If the value to be displayed has no decimal part, only the date part is displayed. If the value to be displayed has no integer part, only the time part is displayed.
D
Display the Day (1-31) with no leading zero ).
Dd
Display the day (01-31) with a leading zero ).
Ddd
Sun-Sat ).
Dddd
The full name indicates Sunday-Saturday ).
Ddddd
It is displayed in full da
exported.
C Displays the date in ddddd and displays the time in TTTTT. If you want to display a number with no decimal digits, only the date part is displayed, and if you want to display no integer portion of the value, only the time portion is displayed.
D
The day (1–31) is displayed with a number that does not have a leading zero.
Dd
Displays the day with a number with a leading zero (01–31).
Ddd
The day (SUN–SAT) is represented by shorthand.
dddd
The day is represented by the full n
afternoon is about 6:50, and the example shown on the system output device is 1001803809710. In this example, it is worth noting that we have used the date constructor to create a date object that does not accept any arguments. And this constructor uses the System.currenttimemillis () method internally to get the date from the system.
So now we know how to get the number of milliseconds we've experienced since January 1, 1970. How can we display this date in a user-understood format? Here the
format the parameters of the mode, you can output the value of the date type to print the string. As for the resolution of the date process, first in accordance with the full requirements of Mask, each of the dates to obtain each element (GetDate (), Getminute () ... can be obtained soon), then according to Mask real condition is what, namely the mask.replace (regular, Element) method to the string template and the replacement between elements, the process of replacement or flag as a sign to ma
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.