-- Hive 只有date('2022-06-09')、TIMESTAMP('2022-07-15 02:21:32.000000') 2个日期类型,没有datetime类型。
select
now(),
current_timestamp(),
current_date(),
date_sub(current_date(), 2),
date_add(current_date(), 2),
date_add('2022-06-09', 2) as c2,
date_sub('2022-06-09 12:13:14', 2) as c3,
date_format('2022-06-09 12:13:14', 'dd-MM-yyyy') as c4,
date_format('2022-06-09 12:13:14', 'yyyy-MM-dd') as c5,
date_format('2022-06-09 12:13:14', 'yyyy-MM') as c6,
date_format('2022-06-09 12:13:14', 'MM') as c7,
date_format(current_date(), 'MM') as c8,
from_unixtime(1657851692, 'yyyy-MM-dd HH:mm:ss'