ExtJS Date Format detailed __js

Source: Internet
Author: User
Tags dateformat month name
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 ();
})

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.