hive‘yyyyMMddhhmmssSSS‘字符串转时间‘yyyy-MM-dd HH:mm:ss.SSS‘

1、‘yyyyMMddhhmmssSSS’字符串转’yyyy-MM-dd HH:mm:ss’

split(from_unixtime(unix_timestamp(createtime,'yyyyMMddHHmmssSSS'),'yyyy-MM-dd HH:mm:ss.SSS'),".00")[0]) as cjsj

2、‘yyyyMMddhhmmssSSS’字符串转’yyyy-MM-dd HH:mm:ss.SSS’

concat(split(from_unixtime(unix_timestamp(createtime,'yyyyMMddHHmmssSSS'),'yyyy-MM-dd HH:mm:ss.SSS'),".00")[0],'.',substr(createtime,-3,3)) as cjsj

你可能感兴趣的:(hive,hive)