久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      oracle怎么將時(shí)間日期轉(zhuǎn)換成時(shí)間戳

      轉(zhuǎn)換方法:1、使用to_char()函數(shù),可將時(shí)間日期按照指定的格式輸出,得到的是字符串,語(yǔ)法“to_char(日期,"轉(zhuǎn)換格式")”;2、使用to_date()函數(shù),語(yǔ)法“to_date("時(shí)間字符串","轉(zhuǎn)換的時(shí)間日期格式")”。

      oracle怎么將時(shí)間日期轉(zhuǎn)換成時(shí)間戳

      本教程操作環(huán)境:Windows7系統(tǒng)、Oracle 11g版、Dell G3電腦。

      oracle時(shí)間日期轉(zhuǎn)換成時(shí)間戳

      在oracle中,將時(shí)間日期轉(zhuǎn)換成時(shí)間戳有兩種方法:

      • to_char()函數(shù)

      • to_date()函數(shù)

      1、to_char()

      將時(shí)間日期按照指定的格式輸出,得到的是字符串,而非date類型。

      to_char(日期,"轉(zhuǎn)換格式" )

      會(huì)把給定的日期按照“轉(zhuǎn)換格式”轉(zhuǎn)換。

      示例:

      select to_char(sysdate, 'yyyy-mm-dd') from dual; select to_char(sysdate, 'yyyy/mm/dd') from dual; select to_char(sysdate, 'yyyymmdd') from dual; select to_char(sysdate, 'yyyymmdd hh24:mi:ss') from dual;

      也可以用to_char()得到單獨(dú)的年月日時(shí)分秒的字符串

      select to_char(sysdate,'yyyy') from dual; select to_char(sysdate,'mm') from dual; select to_char(sysdate,'hh24') from dual; select to_char(sysdate,'mi') from dual;

      2、to_date()

      將字符串轉(zhuǎn)換為具體指定的時(shí)間日期格式

      to_date("時(shí)間字符串","轉(zhuǎn)換的時(shí)間日期格式")

      兩個(gè)參數(shù)的格式必須匹配,否則會(huì)報(bào)錯(cuò)。

      即按照第二個(gè)參數(shù)的格式解釋第一個(gè)參數(shù)。

      示例:

      select to_date('20220103','yyyymmdd') from dual; select to_date('20220103','yyyy-mm-dd') from dual; select to_date('20220103','yyyy/mm/dd') from dual; select to_date('20220103','yyyy-mm-dd hh24:mi:ss') from dual;

      推薦教程:《Oracle教程》

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)