Convert String to Timestamp in Hive HQL
问题 I'm having a string like "08/03/2018 02:00:00" which i'm trying to convert into a timestamp value. I'm using the below code: unix_timestamp("08/03/2018 02:00:00", "yyyy-MM-dd'T'HH:mm:ss.SSSXXX") when i use the above code it's throwing a NULL value. How can i convert this string to Timestamp in Hive/Hue Editor? 回答1: The format you specified does not match to the actual timestamp. If 08/03 in your example is dd/MM then: select unix_timestamp("08/03/2018 02:00:00", "dd/MM/yyyy HH:mm:ss") OK