How do I get a string of format dd-mmm-yy
eg. "26-FEB-19", into timestamp in hive? Cast isn't working as it only takes yyyy-mm-dd
format
Asked
Active
Viewed 1,033 times
0

Luk
- 2,186
- 2
- 11
- 32

Sugat Bajracharya
- 9
- 1
- 2
1 Answers
0
select from_unixtime(unix_timestamp('26-FEB-19','dd-MMM-yy'))
Result:
2019-02-26 00:00:00
Read about format templates here:SimpleDateFormat
Similar question (different format): https://stackoverflow.com/a/49816456/2700344

leftjoin
- 36,950
- 8
- 57
- 116