The Tutorial illustrate an example from the 'Sql Date and Time Format'. To understand this example we use the following syntax that is used to format date and time.
SYNTAX:- DATE_FORMAT(date,format)
date:-This is the field in which we have specified date and time.
format:-The format specifier used here are
%W:- This is used for showing weekday name i.e(Sunday-Saturday).
%e:- This is used for showing Day of the month, numeric
(0-31).
%M :- This is used for showing Month name (January-December)
%Y:- This is used for showing Year, numeric, four digits
%r :- This is used for showing Time, 12-hour (hh:mm:ss
followed by AM or PM)
Query:-
The given below Date_Format(date,format) Query return you the format date in the order of Week,Day,Month,Year and time.
| SELECT DATE_FORMAT('2008-12-15 15:53:00','%W %e %M %Y %r'); |
Output:-
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Sql Date and Time Format View All Comments
Post your Comment