1: sqlserver DATE type: For YYYY-MM-DDHH: MM: SS2.mysql DATE and Time type: DATE, DATE. The supported range is 1000-01-01 to 9999-12-31. MySQL displays a combination of DATEDATETIME, date, and time in YYYY-MM-DD. Supported range: 1000-01-0100:00:00 to 9999
1: SQL server DATE type: For 'yyyy-MM-DD HH: MM: SS 2. mysql DATE and Time type: DATE, DATE. The supported range is '2017-01-01 'to '2017-12-31 '. MySQL displays a combination of date datetime, DATE, and time in 'yyyy-MM-DD 'format. The supported range is '2017-01-01 00:00:00 'to '2017
1: SQL server date type:
For 'yyyy-MM-DD HH: MM: SS
2. mysql Date and Time type:
DATE. The supported range is '2017-01-01 'to '2017-12-31 '. MySQL displays the DATE value in 'yyyy-MM-DD 'format
DATETIME, a combination of date and time. The supported range is '2017-01-01 00:00:00 'to '2017-12-31 23:59:59 '. MySQL displays DATETIME values in 'yyyy-MM-DD HH: MM: ss' format
TIMESTAMP [(M)], Timestamp. Returns a string in 'yyyy-MM-DD HH: MM: ss' format with a fixed display width of 19 characters.
TIME, TIME. The value range is '-838: 59: 59' to '2014: 59: 59 '. MySQL displays the TIME value in the format of 'hh: MM: ss '.
YEAR [(2 | 4)], two or four-digit YEAR. The default format is four bits. In the four-digit format, the allowed values are 1901 to 2155 and 0000. In the two-digit format, the allowed values are 70 to 69, indicating that the value ranges from January 1, 1970 to January 1, 2069. MySQL displays the YEAR Value in YYYY format
3:The default date and time format of JAVA is
Thu Jul 07 17:05:39 CST 2005
To convert the format to, use the SimpleDateFormat class.
SimpleDateFormat formatt = new SimpleDateFormat ("yyyy-MM-dd ");
Date date = new Date ();
System. out. println (formatt. format (date ));
The printed format is:
SimpleDateFormat formatt = new SimpleDateFormat ("yyyy-MMMM-dd ");
Date date = new Date ();
System. out. println (formatt. format (date ));
The printed format is: 2005-July-07
---------------------------
4: default date format of Oracle
SQL> select sysdate from dual;
SYSDATE
----------
Month 7-05
Convert to_char to yyyy-mm-dd format
SQL> select to_char (sysdate, 'yyyy-mm-dd') Time from dual;
TIME
----------
2005-07-07
There are two date-related functions in Oracle: to_date () and to_char ();
To_date () converts the character type to the date type in a certain format:
Specific usage: to_date ('1970-11-27 ', 'yyyy-mm-dd'). The former is a string, and the latter is a conversion date format. Note that the first and second data must be in the correct format.
For example, to_date ('2017-11-27 13:34:43 ', 'yyyy-mm-dd hh24: mi: ss') will get the specific time
To_date () converts the character type to the date type in a certain format:
Specific usage: to_date ('1970-11-27 ', 'yyyy-mm-dd'). The former is a string, and the latter is a conversion date format. Note that the first and second data must be in the correct format.
For example, to_date ('2017-11-27 13:34:43 ', 'yyyy-mm-dd hh24: mi: ss') will get the specific time.
Source: Small Partner Development Network http://www.kaifaer.com/