下载此文档

oracle to char 日期转换字符串(Oracle to char日期转换字符串).doc


文档分类:IT计算机 | 页数:约27页 举报非法文档有奖
1/27
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/27 下载此文档
文档列表 文档介绍
oracle to_char 日期转换字符串(Oracle to_char日期转换字符串)oracle to_char 日期转换字符串(Oracle to_char日期转换字符串)
1 is shown in 12 hours system
SQL>select to_char (sysdate,'YYYY-MM-DD HH12:MI:SS AM') from dual;
TO_CHAR (SYSDATE,'YYYY-MM-DDHH1)
The
2007-06-29 02:50:06 .
2 is shown in 24 hours system
SQL> select to_char (sysdate,'YYYY-MM-DD HH24:MI:SS AM') from dual;
TO_CHAR (SYSDATE,'YYYY-MM-DDHH2)
The
2007-06-29 15:00:58 .
3 gets the first minute of the current time
Select to_char (Sysdate-1/21/60,'HH24:MI:SS') from dual;
TO_CHAR (SYSDATE-1/21/60,'HH24:)
The
15:00:54
4 gets the second minute of the current time
Select to_char (Sysdate+1/21/60,'HH24:MI:SS') from dual;
TO_CHAR (SYSDATE+1/21/60,'HH24:)
The
15:03:53
5 gets one hour before the current time
Select to_char (Sysdate-1/24,'HH24:MI:SS') from dual;
TO_CHAR (SYSDATE-1/24,'HH24:MI:)
The
14:03:13
6 gets one hour after the current time
Select to_char (Sysdate+1/24,'HH24:MI:SS') from dual;
TO_CHAR (SYSDATE+1/24,'HH24:MI:)
The
16:03:32
7 gets the day after the current time
Select to_char (Sysdate+1,'YYYY-MM-DD') from dual;
TO_CHAR (SYSDATE+1,'YYYY-MM-DD')
The
Query the first six months of the current time
Select add_months (sysdate, -6) from dual
1, conversion function
The most important thing to do with the date operation is the two transformation function: to_date (), to_char ()
To_date () acts to convert character types into a date type in a certain format:
Specific uses: to_date ('2004-11-27','yyyy-mm-dd'), the former is a string, the latter is the format of the conversion date, pay attention to, before and after the two should be a correspondence.
For example, to_date ('2004-11-27 13:34:43','yyyy-mm-dd hh24:mi:ss') will get the specific time
Multiple date formats:
YYYY: four bit representation of the year
YYY, YY, Y: the last three, two or one of the year, the default is the current century
The month number of MM:01~12
MONTH: the month represented by nine characters, and the right is filled with blanks
MON: Monthly abbreviati

oracle to char 日期转换字符串(Oracle to char日期转换字符串) 来自淘豆网m.daumloan.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数27
  • 收藏数0 收藏
  • 顶次数0
  • 上传人rjmy2261
  • 文件大小25 KB
  • 时间2017-11-22