操作hive表的日期时间函数


Date Functions:
unix_timestamp()获得时间戳
from_unixtime(unix_timestamp())将时间戳转换成时间

date_sub:
date_sub(date/timestamp/string startdate, tinyint/smallint/int days)
Subtracts a number of days to startdate: date_sub('2008-12-31', 1) = '2008-12-30'.
求出起始日期减去某个天数之后的日期。

你可能感兴趣的:(操作hive表的日期时间函数)