Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Some time conversions commonly used in oracle

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Some commonly used are time formats

select TO_CHAR(SYSDATE,'HH24:MI:SS AM') from dual ---12: 56:40 PM

select TO_CHAR(TO_DATE('21-Jan-95'),'Y-MM-DD HH24:MI:SS AM') from dual---1995-01-21 00:00:00 AM

select TO_CHAR(SYSDATE,'DD "of" MONTH') from dual ---28 of July

select TO_CHAR(TO_DATE('25-Jul-95'),'DD "of" MONTH') from dual ---25 of Jul

select to_char(sysdate, 'ddspth') from dual ---twenty-eighth

select TRUNC(TO_DATE('25-Jul-95') ,'ddspth') from dual -- 1995-7-25

---Date Format Query

select to_char(to_date ('26 -08- 2002','dd-mm-y'),' day') from dual;--Monday

select to_char(to_date('2002-08-26','y-mm-dd')) from dual; --26-8月 -02

select to_date('2002-08-26','yyyy-mm-dd') from dual; --2002-8-26

select to_char(sysdate,'yyyy-mm-dd hh34:mi:ss') from dual; ---2015-07-28 13:01:14

--Days of the month

SELECT to_char(last_day(SYSDATE),'dd') days FROM daily--31

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report