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, 5659👍, 0💬
Popular Posts:
What is difference between custom JSP tags and JavaBeans? Custom JSP tag is a tag you defined. You d...
How To Control Horizontal Alignment? - XHTML 1.0 Tutorials - Understanding Tables and Table Cells By...
How To Decrement Dates by 1? - MySQL FAQs - Introduction to SQL Date and Time Handling If you have a...
Which is the best place to store ConnectionString in Dot Net Projects? I am about to deploy my first...
What are the core functionalities in XML .NET framework? Can you explain in detail those functionali...