Convert string into timestamp in Hive
11,730
The format is yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
.Note the single quotes surrounding 'T'
select from_unixtime(unix_timestamp("2017-09-27T19:25:15.927-07:00", "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"))
Comments
-
Petros Tsialiamanis almost 2 years
I have a value '2017-09-27T19:25:15.927-07:00', is there any way to convert this into a timestamp? I use Hive 1.1.0.
select unix_timestamp("2017-09-27T19:25:15.927-07:00", "yyyy-MM-ddTHH:mm:ss.SSSX")
but it trowsBad date/time conversion format
select unix_timestamp("2017-09-27T19:25:15.927-07:00", "yyyy-MM-ddTHH:mm:ss.SSSZZZ")
but it returnsNULL