hive:函数:日期函数:to_date(),year(),month(),day(),hour(),minute(),second(),weekofyear()日期转周
语法: to_date(string timestamp)返回值: string说明: 返回日期时间字段中的日期部分。举例:select to_date('2018-12-08 10:03:01') date;返回:2018-12-08
·
select to_date('2018-12-08 10:03:01');--2018-12-08 返回日期时间字段中的日期部分
select year('2018-12-08 10:03:01');--2018
select year('2018-12-08');--2018
select month('2018-12-08 10:03:01');--12
select month('2018-12-08');--12
select day('2018-12-08 10:03:01');--8
select day('2018-12-08');--8
select hour('2018-12-08 10:03:01');--10
select minute('2018-12-08 10:03:01');--3
select second('2018-12-08 10:03:01');--1
select weekofyear('2018-12-08 10:03:01')--49
更多推荐
已为社区贡献1条内容
所有评论(0)