as: 2004-8-7
DDDDDD Displays the year date in a long format
FormatDateTime (' dddddd ', now);
Output is: August 7, 2004
E/ee/eee/eeee with the corresponding number of digits to show the year
FormatDateTime (' ee ', now);
Output is: 04 (04)
M/mm/mmm/mmmm said the Month
FormatDateTime (' m ', now);
Output as: 8
FormatDateTime (' mm ', now);
Output is 08
FormatDateTime (' mmm ', now);
Output for August
FormatDateTime ('
200 replies returned. If some commands are not supported for the server, return to the confirm completion answer, so that the user process is able to perform the following command. If the request is not an optional implementation of the command, and this command does not implement, it is necessary to return code 502. Here we list each response code in numerical order and its meaning:
110
Reboot the tag response. In this case the text is OK, it must be: Mark
seconds displayed is: 0~59, where a value of less than 10 is preceded by a 0.
T
Displays the first character in the AM/PM indicator for a given time.
TT (+)
Displays the complete AM/PM indicator for a given time.
Y/yy/yyyy
Displays the year in a given time.
Z/zz/zzz (+)
Displays the time zone offset for the given period.
Let's look at the following code, which shows a date and time st
Tostring record for your convenience, and tostring record viewing
C
Currency
2.5.ToString ("C ")
¥2.50
D
Decimal number
25. ToString ("D5 ")
00025
E
Scientific type
25000. ToString ("E ")
2.500000E + 005
F
Fixed Point
25. ToString ("F2 ")
25.00
G
General
2.5.ToString ("G ")
2.5
N
Number
2500000. ToString ("N ")
2,500,000.00
X
Hexadecimal
255. ToString ("X ")
FF
N
are not listed on MSDN.1. Y represents the year, note is lowercase y, and uppercase y does not represent the year.2. m represents the month.3. D represents the date, noting that D does not mean anything.4. h or H represents hours, H is 12 hours, H is 24 hours.5. m represents minutes.6. s represents seconds. Note that s doesn't mean anything.
Format
Output
Example
Years
Y
7
String yy = DateTime.Now.ToString ("y-mm")Yy= "7-05"
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, the output will be: May.For an English operating system, enter the abbreviation of the first three letters of the Month: May
String MON = datetime. parse ("2006-07-01"). tos
currency symbol to a number, and a thousand character, currency (symbol)
Number
various formats of numbers, which are fully compatible with PHP's Number_format, have three parameters. Decimals optional, specify how many decimal digits. Dec_point Optional, which specifies the string to use as the decimal point (the default is
. ). Thousands_sep Optional, which specifies the string to use as the thousand separator (default
, ), and all other paramet
value is {0,7:d}", i);String s2=string. Format ("The value is {0,7:f3}", j);THIS.TEXTBOX1.TEXT=S1;Results The value is 123THIS.TEXTBOX2.TEXT=S2;Results The value is 123.450(3) Double i=12345.6789;This.textbox1.text=i.tostring ("F2"); Results 12345.68This.textbox2.text=i.tostring ("F6");Results 12345.678900(4) Double i=12345.6789;This.textbox1.text=i.tostring ("n"); Result 12,345.68This.textbox2.text=i.tostring ("N4"); Result 12,345.6789(5) Double i=0.126;String s=string. Format ("The value is {
-- CREATE a recursive tree History TABLE and generate the data create table TREE_HIS (id number, C_CHILD VARCHAR2 (32 BYTE), C_NAME VARCHAR2 (100 BYTE), P_ID NUMBER, EFF_DATE DATE, EXP_DATE DATE); create index IDX2 ON TREE_HIS (P_ID); create unique index IDX3 ON TREE_HIS (C_CHILD, EXP_DATE); create unique index TREE_HIS_PK ON TREE_HIS (ID ); alter table TREE_HIS ADD (CONSTRAINT TREE_HIS_PK primary key (ID); alter table TREE_HIS ADD (CONSTRAINT TREE_HIS_R01 foreign key (P_ID) REFERENCES TREE_HIS
Formatted string of DateTime. Now. ToString in. NET, datetime. tostring
In. NET, DateTime. Now. ToString is displayed in milliseconds:DateTime. Now. ToString ("yyyy-MM-dd HH: mm: ss. fff ")
Other formatting strings of DateTime. Now. ToString:
Format a string
Meaning
Example
D
Long date
Thursday, 10 then l 2008
D
Short date
04/10/2008
F
Full date long
Thursday, 10 minutes l 2008 06:30:00
U
Universal sortable, local time
2002-12-10 22: 13: 50z
U
Universal sortable, GMT
December 11,200 2 3:13:50 AM
Y
Year month pattern
December 2002
The 'U' specifier seems broken; that string certainly isn' t sortable.
Custom date formatting:
Specifier
Type
Example
Example Output
Dd
Day
{0: dd}
10
Ddd
Day name
{0: ddd}
Tue
Dddd
Full day name
{0: dddd}
Tuesday
F, ff
Y
Year month pattern
December 2002
The 'U' specifier seems broken;
Specifier
Type
Example
Example output
Dd
Day
{0: dd}
10
Ddd
Day name
{0: DDD}
Tue
Dddd
Full day name
{0: dddd}
Tuesday
F, FF ,...
Second Fractions
{0: fff}
932
GG ,...
Era
{0: Gg}
A.D.
HH
2 digit hour
{0: hh}
10
HH
2 digit hour, 24hr format
{0: hh}
22
Mm
I copied the jquery datepicker structure and copied the class name. So a calendar is born.
the above structure is divided into two parts: the top calendar, and some form elements below are used to control the calendar configuration.
Aveon. ready (function () {aveon. define ("datepicker", function (VM) {// configure VM. changeyear = false VM. changemonth = false VM. mindate = new date (2013, 3, 25); // VM. maxdate VM. showothermonths = false; VM. showbuttonpanel = false; // VM at the curre
U
Universal sortable, GMT
December 11,200 2 3:13:50 AM
Y
Year month pattern
December 2002
The 'U' specifier seems broken; that string certainly isn' t sortable.
Custom date formatting:
Specifier
Type
Example
Example Output
Dd
Day
{0: dd}
10
Ddd
Day name
{0: ddd}
Tue
Dddd
Full day name
{0: dddd}
Tuesday
F, ff ,...
Second fractions
{0: fff}
932
Gg ,...
Era
(Timeinmillis);
Create a DateTime object using Java.util.Date
Java.util.Date jdkdate = Obtaindatesomehow ();
datetime = new DateTime (jdkdate);
Create a DateTime object directly with different objects
Use a calendar
Java.util.Calendar calendar = obtaincalendarsomehow ();
datetime = new DateTime (calendar);
Use another Joda datetime
datetime anotherdatetime = Obtaindatetimesomehow ();
datetime = new DateTime (anotherdatetime);
Use a String (must is formatted properly)
/Note that if you
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.