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, 5262👍, 0💬
Popular Posts:
Which one of the following statements is TRUE in regard to overloading the ++ operator? 1 You cannot...
Why does malloc(0) return valid memory address? What's the use? malloc(0) does not return a non-NULL...
What is DAR (Decision Analysis and Resolution) ? Decision Analysis and Resolution is to analyze poss...
How do we assign page specific attributes ? Page attributes are specified using the @Page directive.
How Large Can a Single Cookie Be? - PHP Script Tips - Understanding and Managing Cookies How large c...