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