Time difference in HIVE -
i trying find difference between 2 timestamps in hive. date_time field string, need convert date_time format before finding time difference.
this code using, null.
select unix_timestamp(to_date("2016-12-30 10:39:46"),'hh:mm:ss') - unix_timestamp(to_date("2016-12-30 10:39:31"),'hh:mm:ss');
i need difference 15 seconds.
any suggestions great !!
please try this:
select unix_timestamp('2016-12-30 10:39:46') - unix_timestamp('2016-12-30 10:39:31');
it should give time difference in seconds.
Comments
Post a Comment