oracle日期转换
来源:互联网 发布:全民淘宝客能挣钱吗 编辑:程序博客网 时间:2024/06/06 17:25
--To_date格式
--to_date(字符串,’yyyymm’) 201201
select to_date(201611,'yyyymm') from dual;
--to_date(字符串,’yyyy-mm’)
select to_date(201611,'yyyy-mm') from dual;
--to_date(字符串,’yyyymmdd’)
select to_date(20161116,'yyyymmdd') from dual;
--to_date(字符串,’yyyy-mm-dd’)
select to_date(20161116,'yyyy-mm-dd') from dual;
--to_date(字符串,’yyyymmdd hh’)
select to_date(2016111610,'yyyymmdd hh') from dual;
--to_date(字符串,’yyyy-mm-dd hh’)
select to_date(2016111610,'yyyy-mm-dd hh') from dual;
select to_date(2016111616,'yyyy-mm-dd hh24') from dual;
--to_date(字符串,’yyyymmdd hh24:mi’)
select to_date(201611161651,'yyyymmdd hh24:mi') from dual;
--to_date(字符串,’yyyymmdd hh24:mi:ss’)
select to_date(20161116165143,'yyyymmdd hh24:mi:ss') from dual;
--sysdate
select sysdate from dual;
--To_char语法
--to_char(日期,’d’)—返回值为本周第几天;
select to_char(sysdate,'d') from dual;
--to_char(日期,’dd’)—返回值为本月第几天;
select to_char(sysdate,'dd') from dual;
--to_char(日期,’w’)—返回值为本月第几周
select to_char(sysdate,'w') from dual;
--to_char(日期,’ww’)—返回值为本年第几周
select to_char(sysdate,'ww') from dual;
--to_char(日期,’mm’)—返回值为日期月份
select to_char(sysdate,'mm') from dual;
--to_char(日期,’yyyy’)—返回值为年
select to_char(sysdate,'yyyy') from dual;
--to_char(日期,’yyyymm’)—返回值为年月
select to_char(sysdate,'yyyymm') from dual;
--to_char(日期,’yyyymmdd’)—返回值为年月日
select to_char(sysdate,'yyyymmdd') from dual;
--to_char(日期,’yyyymmdd hh24’)—返回值为年月日时
select to_char(sysdate,'yyyymmdd hh24') from dual;
--to_char(日期,’yyyymmdd hh24:mi’)—返回值为年月日时分
select to_char(sysdate,'yyyymmdd hh24:mi') from dual;
--to_char(日期,’yyyymmdd hh24:mi:ss’)—返回值为年月日时分秒
select to_char(sysdate,'YYYYMMDD HH24:MI:SS') from dual;
--to_date(字符串,’yyyymm’) 201201
select to_date(201611,'yyyymm') from dual;
--to_date(字符串,’yyyy-mm’)
select to_date(201611,'yyyy-mm') from dual;
--to_date(字符串,’yyyymmdd’)
select to_date(20161116,'yyyymmdd') from dual;
--to_date(字符串,’yyyy-mm-dd’)
select to_date(20161116,'yyyy-mm-dd') from dual;
--to_date(字符串,’yyyymmdd hh’)
select to_date(2016111610,'yyyymmdd hh') from dual;
--to_date(字符串,’yyyy-mm-dd hh’)
select to_date(2016111610,'yyyy-mm-dd hh') from dual;
select to_date(2016111616,'yyyy-mm-dd hh24') from dual;
--to_date(字符串,’yyyymmdd hh24:mi’)
select to_date(201611161651,'yyyymmdd hh24:mi') from dual;
--to_date(字符串,’yyyymmdd hh24:mi:ss’)
select to_date(20161116165143,'yyyymmdd hh24:mi:ss') from dual;
--sysdate
select sysdate from dual;
--To_char语法
--to_char(日期,’d’)—返回值为本周第几天;
select to_char(sysdate,'d') from dual;
--to_char(日期,’dd’)—返回值为本月第几天;
select to_char(sysdate,'dd') from dual;
--to_char(日期,’w’)—返回值为本月第几周
select to_char(sysdate,'w') from dual;
--to_char(日期,’ww’)—返回值为本年第几周
select to_char(sysdate,'ww') from dual;
--to_char(日期,’mm’)—返回值为日期月份
select to_char(sysdate,'mm') from dual;
--to_char(日期,’yyyy’)—返回值为年
select to_char(sysdate,'yyyy') from dual;
--to_char(日期,’yyyymm’)—返回值为年月
select to_char(sysdate,'yyyymm') from dual;
--to_char(日期,’yyyymmdd’)—返回值为年月日
select to_char(sysdate,'yyyymmdd') from dual;
--to_char(日期,’yyyymmdd hh24’)—返回值为年月日时
select to_char(sysdate,'yyyymmdd hh24') from dual;
--to_char(日期,’yyyymmdd hh24:mi’)—返回值为年月日时分
select to_char(sysdate,'yyyymmdd hh24:mi') from dual;
--to_char(日期,’yyyymmdd hh24:mi:ss’)—返回值为年月日时分秒
select to_char(sysdate,'YYYYMMDD HH24:MI:SS') from dual;
0 0
- oracle 日期 毫秒转换日期
- oracle日期转换函数
- oracle日期的转换
- ORACLE 日期时间转换
- oracle 日期转换
- oracle to_char() 日期转换
- oracle 日期格式转换
- oracle日期转换
- Oracle 毫秒日期转换
- oracle日期格式转换
- Oracle转换日期
- oracle日期转换函数
- oracle日期转换
- oracle日期转换函数
- oracle日期转换函数
- oracle日期转换函数
- ORACLE日期转换 操作
- oracle 日期转换
- es6 javascript的Number数字类型的原型新增加的方法
- opencv中人眼中心的检测(C++)
- nodejs 导出数据和文件压缩包
- Dalvik 与 ART
- 快速幂
- oracle日期转换
- linux目录结构详细介绍
- Android 6.0动态获取权限开源项目
- 禁止vim生成 un~文件
- tomcat配置摘要认证
- java设计模式之适配器设计模式
- 创建Fiddler4的插件(总结)
- Android 4.0以上设备的虚拟按键中menu键的显示问题
- 用户画像数据建模方法