최종 업데이트일: 2016-10-27


[날짜 처리하기] 유닉스타임을 타임스탬프로 변환

select from_unixtime(1477365132)


결과: 

2016-10-25 12:12:12.0



[날짜 처리하기] 타임스탬프에서 년월일만 나오도록 하기

select date_trunc('day', from_unixtime(1477365132))


결과:

2016-10-25 00:00:00.0


[날짜 처리하기] 두 날짜의 차이 구하기

select date_diff( 

'day', 

from_iso8601_timestamp('2016-10-24'),  

from_iso8601_timestamp('2016-10-25')

)

결과: 1




'Presto' 카테고리의 다른 글

Presto에서 base64 데이터 디코딩하기  (0) 2016.08.17
Presto에서 JSON 다루기  (0) 2016.08.12

+ Recent posts