Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Convert Dates to Character Strings
How To Convert Dates to Character Strings? - MySQL FAQs - Introduction to SQL Date and Time Handling
✍: FYIcenter.com
You can convert dates to character strings using the DATE_FORMAT(date, format) function. MySQL supports the following basic formatting codes:
The tutorial exercise below shows you some good examples:
SELECT DATE_FORMAT('1997-01-31', '%W, %M %e, %Y') FROM DUAL; Friday, January 31, 1997 SELECT DATE_FORMAT('1997-01-31 09:26:50.000123', '%W, %M %e, %Y, at %h:%i:%s %p') FROM DUAL; Friday, January 31, 1997, at 09:26:50 AM | SELECT DATE_FORMAT('1997-01-31 09:26:50.000123', '%d-%b-%Y %H:%i:%s.%f') FROM DUAL; 31-Jan-1997 09:26:50.000123
2007-05-11, 5362👍, 0💬
Popular Posts:
How can you raise custom errors from stored procedure ? The RAISERROR statement is used to produce a...
How To Control Table Widths? - XHTML 1.0 Tutorials - Understanding Tables and Table Cells Usually, b...
How can I implement a variable field width with printf? That is, instead of something like %8d, I wa...
1. The basics first, please define the web in simple language? How is it connected with internet? Wh...
How do you locate the first X in a string txt? A) txt.find('X'); B) txt.locate('X'); C) txt.indexOf(...