mysql相似于oracle的to_char() to_date()方法
2016-04-25 18:28
459 查看
mysql日期和字符相互转换方法
date_format(date,'%Y-%m-%d') -------------->oracle中的to_char();
str_to_date(date,'%Y-%m-%d') -------------->oracle中的to_date();
%Y:代表4位的年份
%y:代表2为的年份
%m:代表月, 格式为(01……12)
%c:代表月, 格式为(1……12)
%d:代表月份中的天数,格式为(00……31)
%e:代表月份中的天数, 格式为(0……31)
%H:代表小时,格式为(00……23)
%k:代表 小时,格式为(0……23)
%h: 代表小时,格式为(01……12)
%I: 代表小时,格式为(01……12)
%l :代表小时,格式为(1……12)
%i: 代表分钟, 格式为(00……59)
%r:代表 时间,格式为12 小时(hh:mm:ss [AP]M)
%T:代表 时间,格式为24 小时(hh:mm:ss)
%S:代表 秒,格式为(00……59)
%s:代表 秒,格式为(00……59)
date_format(date,'%Y-%m-%d') -------------->oracle中的to_char();
str_to_date(date,'%Y-%m-%d') -------------->oracle中的to_date();
%Y:代表4位的年份
%y:代表2为的年份
%m:代表月, 格式为(01……12)
%c:代表月, 格式为(1……12)
%d:代表月份中的天数,格式为(00……31)
%e:代表月份中的天数, 格式为(0……31)
%H:代表小时,格式为(00……23)
%k:代表 小时,格式为(0……23)
%h: 代表小时,格式为(01……12)
%I: 代表小时,格式为(01……12)
%l :代表小时,格式为(1……12)
%i: 代表分钟, 格式为(00……59)
%r:代表 时间,格式为12 小时(hh:mm:ss [AP]M)
%T:代表 时间,格式为24 小时(hh:mm:ss)
%S:代表 秒,格式为(00……59)
%s:代表 秒,格式为(00……59)
相关文章推荐
- Oracle用定时任务存储过程将数据转存到历史表,提高查询速度
- Oracle 11g笔记——自动存储管理(ASM)
- Oracle 11g笔记——调整表空间和数据文件的大小、移动数据文件、联机重做日志文件、控制文件
- 坑爹的oracle11g新特性 密码延迟验证
- oracle imp-000008错误的解决办法
- Oracle 复合索引
- oracle的正则表达式 [转载]
- Oracle-BPM(六)
- Oracle-BPM(五)
- Oracle与SQL Server数据库的异同
- Oracle-BPM(三)
- Oracle-BPM(一)
- Oracle常用命令
- Oracle数据库合并行记录,WMSYS.WM_CONCAT 函數的用法
- oracle-2中commit 详解
- 十五oracle 触发器
- 十四 oracle 视图
- Oracle EBS 高级定价中定价属性的定义过程
- 十三oracle --控制结构(分支,循环,控制)
- Oracle多表查询