to_date:日期时间转日期函数
select to_date(‘2015-04-02 13:34:12’);
输出:2015-04-02
from_unixtime:转化unix时间戳到当前时区的时间格式
select from_unixtime(1323308943,’yyyyMMdd’);
输出:20111208
unix_timestamp:获取当前unix时间戳
select unix_timestamp();
输出:1430816254
select unix_timestamp(‘2015-04-30 13:51:20’);
输出:1430373080
year:返回日期中的年
select year(‘2015-04-02 11:32:12’);
输出:2015
month:返回日期中的月份
select month(‘2015-12-02 11:32:12’);
输出:12
day:返回日期中的天
select day(‘2015-04-13 11:32:12’);
输出:13
推荐:oracle 的时间日期转换函数
http://hi.baidu.com/cuigq_hr/blog/item/ba2bc167ed79022eaa184c34.html 1.有sysdate转换后的日期的例子总结: select to_char(sysdate, 'yyyy-mm-dd hh24:mi
hour:返回日期中的小时
select hour(‘2015-04-13 11:32:12’);
输出:11
minute:返回日期中的分钟
select mi