Presto individual common operations

Timestamp turn date:

from_unixtime(1569168000,'yyyy-MM-dd') = '2019-09-23'

  

'20190903' converted to '2019-09-23':

unix_timestamp('20190903','yyyymmdd'),'yyyy-mm-dd')

 

  

Subtract the number of days greater than 7 days:

datediff(from_unixtime(unix_timestamp('20190903','yyyymmdd'),'yyyy-mm-dd'),from_unixtime(1569168000,'yyyy-MM-dd')) >= 7

 

  

Get the current date:

select current_date  -- 如 2019-09-23

 

  

 

Guess you like

Origin www.cnblogs.com/tianqizhi/p/11577442.html