JS DateFormat usage

Source: Internet
Author: User
Tags dateformat month name

Items: [{fieldlabel: ' Year ', Xtype: ' TextField ', Name: ' Sryear ', Maxlength:4, width:100, Value:g_today.dateFormat (' Y ') }]

One, in Oracle, when you want to put the string as ' .- the- -  ,: -: $' format into a date format, we can use the To_date function provided by Oracle. The SQL statement is: SELECT to_date ('2011-09-20 08:30:45','YYYY-MM-DD Hh24:mi:ss') from dual; Conversely, you can use the To_char () function to convert dates into strings. The SQL statement is: SELECT to_char (Sysdate,'YYYY-MM-DD Hh24:mi:ss') from dual; Second, in MySQL, the date_format (date, format) function formats the date value according to the format string. %M-month name (January ... December)%W-week name (Sunday ... Saturday)%D The date of the month with English prefixes (1st, 2nd, 3rd, etc.). )%Y years, numbers,4bit%y years, numbers,2bit%a abbreviated weekday name (Sun ... Sat)Number of days in the month of%d, number (xx...... to) Number of days in%e month, number (0...... to) %m Month, Number ( on...... A) %c Month, Number (1...... A) %b abbreviated month name (Jan ... DEC)%j Days of the Year (001......366) %H hours (xx...... at) %k hours (0...... at) %h hours ( on...... A) %I Hours on...... A) %l hours (1...... A) %i minutes, Number (xx...... -) %r time, Ahours (hh:mm:ss [ap]m)%T time, -hours (HH:MM:SS)%s seconds (xx...... -) %s seconds (xx...... -) %P AM or PM%w one days in the week (0=sunday ...6=Saturday)%u weeks (0...... the), here Sunday is the first day of the week%u weeks (0...... the), here Monday is the first day of the weekPercent of a literal "%". Convert string to date format Select Date_format ('2011-09-20 08:30:45','%y-%m-%d%h:%i:%s'); Convert date to string format select Date_format (now (),'%y-%m-%d%h:%i:%s');

JS DateFormat usage

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.