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, 5532👍, 0💬
Popular Posts:
How To Get the Uploaded File Information in the Receiving PHP Script? Once the Web server received t...
What are some uses of Intranets & Extranets? An "intranet" is the generic term for a collect...
How is the MVC design pattern used in Struts framework? In the MVS design pattern, there 3 component...
What will be printed as the result of the operation below: main() { int x=10, y=15; x = x++; y = ++y...
How To Blend a Color Layer to a Image? - PSP Tutorials - Fading Images to Background Colors with PSP...