<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ●▲● **日期轉時間戳:`unix_timesttamp`** ```sql --日期轉時間戳:從 1970-01-01 00:00:00 UTC 到指定時間的秒數 -- 獲得當前時區的 UNIX 時間戳 hive> select unix_timestamp(); 1620957255 hive> select unix_timestamp('2017-09-15 14:23:00'); 1505456580 hive> select unix_timestamp('2017-09-15 14:23:00','yyyy-MM-dd HH:mm:ss'); 1505456580 hive> select unix_timestamp('20170915 14:23:00','yyyyMMdd HH:mm:ss'); 1505456580 ``` ●▲● **時間戳轉日期:`from_unixtime`** ```sql hive> select from_unixtime(1505456567); 2017-09-15 14:22:47 hive> select from_unixtime(1505456567,'yyyyMMdd'); 20170915 hive> select from_unixtime(1505456567,'yyyy-MM-dd HH:mm:ss'); 2017-09-15 14:22:47 -- 獲取時間戳中的周 hive> select from_unixtime(1505456567,'u'); 5 hive> select from_unixtime(1505456567,'E'); Fri ``` ●▲● **獲取當前日期: `current_date()`** ```sql hive> select current_date(); 2021-05-14 ``` ●▲● **從日期時間中提取日期:`to_date(string timestamp)`** ```sql hive> select to_date('2017-09-15 11:12:00'); 2017-09-15 ``` ●▲● **獲取日期中的年/月/日/時/分/秒/周** ```sql hive> with dtime as(select from_unixtime(unix_timestamp(),'yyyy-MM-dd HH:mm:ss') as dt) select year(dt) year, month(dt) month, day(dt) day, hour(dt) hour, minute(dt) minute, second(dt) second, weekofyear(dt) weekofyear from dtime; +-------+--------+------+-------+---------+---------+-------------+--+ | year | month | day | hour | minute | second | weekofyear | +-------+--------+------+-------+---------+---------+-------------+--+ | 2021 | 4 | 24 | 4 | 18 | 18 | 16 | +-------+--------+------+-------+---------+---------+-------------+--+ ``` ●▲● **計算兩個日期之間的天數: `datediff`** ``` hive> select datediff('2017-09-15','2017-09-01'); ``` ●▲● **日期增加和減少: `date_add/date_sub(string startdate,int days)`** ```sql hive> select date_add('2017-09-15',1); 2017-09-16 hive> select date_sub('2017-09-15',1); 2017-09-14 ``` ●▲● 獲取當前系統時間(包括毫秒數) ```sql hive> select current_timestamp; 2021-04-24 04:23:48.175 ``` ●▲● 其他日期函數 ```sql -- 查詢當月第幾天: hive> select dayofmonth('2021-04-24 04:23:48.175'); 24 -- 月末 hive> select last_day('2021-04-24 04:23:48.175'); 2021-04-30 -- 當月第 1 天 hive> select date_sub('2021-04-24 04:23:48.175',dayofmonth('2021-04-24 04:23:48.175')-1); 2021-04-01 -- 下個月第 1 天 hive> select add_months(date_sub('2021-04-24 04:23:48.175',dayofmonth('2021-04-24 04:23:48.175')-1),1); 2021-05-01 ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看