Date formats comparisons in three databases:
- MySQL
- SQL Server
- Oracle
Formats example date: 13 Mar , 2018
Example | MySQL Server | SQL Server | Oracle |
---|---|---|---|
2018
|
%Y
|
yyyy
|
YYYY
|
18
|
%y
|
yy
|
YY
|
March
|
%M
|
MMMM
|
MONTH
|
Mar
|
%b
|
MMM
|
MON
|
03
|
%m
|
MM
|
MM
|
Tue
|
%a
|
ddd
|
DY
|
13
|
%d
|
dd
|
DD
|
Examples for Testing
MySQL Server:
SQL Server:
Oracle:
SELECT TO_CHAR ( SYSDATE , 'DD Mon, YYYY' ) AS CurrentDate FROM TableName;
Output:
Output:
0 Comments