hive中的時間操作

2021-09-08 17:21:21 字數 893 閱讀 1337

1.獲取系統當前時間戳

2.將時間戳轉換成時間,並且按照指定的格式進行格式化

3.將日期轉換成時間戳

4.日期時間轉日期函式: to_date語法: to_date(string timestamp)

5.獲取時間的年份部分、月份、天、小時、分鐘…

select year(』2011-12-08 10:03:01′)

結果:2011

select month(』2011-12-08 10:03:01′)

結果:12

select day(』2011-12-08 10:03:01′)

結果:08

select hour(』2011-12-08 10:03:01′)

結果:10

select minute(』2011-12-08 10:03:01′)

結果:03

hive 時間操作函式

日期函式unix時間戳轉日期函式 from unixtime語法 from unixtime bigint unixtime string format 返回值 string 說明 轉化unix時間戳 從1970 01 01 00 00 00 utc到指定時間的秒數 到當前時區的時間格式 舉例 hi...

hive時間操作函式

標籤 hive 函式linux 2016 12 21 16 07 49人閱讀收藏 舉報 hive 日期函式unix時間戳轉日期函式 from unixtime語法 from unixtime bigint unixtime string format 返回值 string 說明 轉化unix時間戳 ...

hive 時間操作函式

日期函式unix時間戳轉日期函式 from unixtime語法 from unixtime bigint unixtime string format 返回值 string 說明 轉化unix時間戳 從1970 01 01 00 00 00 utc到指定時間的秒數 到當前時區的時間格式 舉例 hi...