Format Output Description
------ ---------- --------------------------------------------------------------
d ' The month, 2 digits with leading zeros
D Wed A textual representation of a day, three letters
J Day of the month without leading zeros
L Wednesday A full textual representation of the day of the week
S th 中文版 ordinal day of month suffix, 2 chars (use with J)
W 3 Numeric representation of the day of the week
Z 9 The Julian Date, or Day of the Year (0-365)
W ISO-8601 2-digit Week number of year, weeks starting on Monday (00-52)
F January A full textual representation of the month
M-Numeric representation of a month, with leading zeros
M Month name abbreviation, three letters
N 1 Numeric representation of a month, without leading zeros
T number of days in the given month
L 0 Whether It's a leap year (1 if it's a leap year, else 0)
Y 2007 A full numeric representation of a year, 4 digits
Y-two digit representation of a year
A PM lowercase Ante meridiem and Post Meridiem
A PM uppercase Ante meridiem and Post Meridiem
G 3 12-hour format of hour without leading zeros
24-hour format of an hour without leading zeros
H 12-hour format of hour with leading zeros
H 24-hour format of hour with leading zeros
I Minutes with leading zeros
S Seconds, with leading zeros
O-0600 difference to Greenwich time (GMT) in hours
T CST Timezone setting of the machine running the code
Z-21600 Timezone offset in seconds (negative if West to UTC, positive if east)
Such as: The current time is accurate to the second var date = new Date (). DateFormat (' y-m-d h:i:s ');
To obtain the value of the xtype: "Datefield", the value to be fetched. DateFormat (' y-m-d h:i:s '); You can insert a database like this.
For example: Alert (Clientinfoeditform.findbyid ("IntDateChange1"). GetValue (). DateFormat ("y-m-d h:i:s"));
Ext.onready (function () {
var v1 = "Welcome to Zhongtian!";
var win = new Ext.window ({
Title: User profile,
width:400,
height:260,
Layout: "Form",
Xtype: "Form", br>//default left-aligned
//labelalign: "Right",
Labelwidth:60,
items:[
{xtype: "hidden", Name: "id"},
{
Xtype: "Datefield",
Fieldlabel: "Date of birth",
Name: "Birthday",
Fomat: "y-m-d"
}
]
})
Win. Show ();
})