Oracle中时间格式转化

上一篇 / 下一篇  2012-04-10 15:36:05 / 个人分类:数据库

--日期转化为字符串  
select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') table1;  

--获取时间的年   
select to_char(sysdate,'yyyy')  from table1; 

--获取时间的月 
select to_char(sysdate,'mm')  from table1;   

--获取时间的日
select to_char(sysdate,'dd')    from table1;     

--获取时间的时 
select to_char(sysdate,'hh24')   from table1;     

--获取时间的分   
select to_char(sysdate,'mi')   from table1;  

--获取时间的秒  
select to_char(sysdate,'ss') from table1; 

TAG: 时间 Oracle oracle

 

评分:0

我来说两句

日历

« 2024-03-19  
     12
3456789
10111213141516
17181920212223
24252627282930
31      

数据统计

  • 访问量: 169587
  • 日志数: 53
  • 建立时间: 2009-02-16
  • 更新时间: 2016-01-26

RSS订阅

Open Toolbar