Home > Database > Mysql Tutorial > body text

mysql和oracle之间的几个步骤转换

WBOY
Release: 2016-06-07 16:23:43
Original
936 people have browsed it

mysql和oracle之间的几个方法转换 一、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:代表月,

mysql和oracle之间的几个方法转换
一、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)
二、mysql中日期加减
ADDDATE(expr,days);
三、sysdate转换
SYSDATE()-----------------------oracle中的SYSDATE
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!