hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gabriel Eisbruch <gabrieleisbr...@gmail.com>
Subject Re: Need help in Date format
Date Fri, 13 Jun 2014 00:21:45 GMT
Hey,
 I think you can use from_unixtime(unix_timestamp(your_field, "dd-MMM-yyyy"
),"dd-MM-yyyy")

Thanks,
Gabo.


2014-06-12 21:01 GMT-03:00 Krishnan Narayanan <krishnan.smile@gmail.com>:

> Hi All,
>
> I have my date format as 08-Mar-2014 how to I change it to 08-03-2014?
> Can I use regexp_replace.
>
> I tried below but not getting the desired output.
>
>
> regexp_replace(started_dt,"\Jan|\Feb|\Mar|\Apr|\May|\Jun|\Jul|\Aug|\Sep|\Oct|\Nov|\Dec","\01|\02|\03|\04|\05|\06|\07|\08|\09|\10|\11|\12")
>
> Output: 09-1|2|3|4|5|6|7|8|9|10|11|12-2014 16:19:56.
> Help is much appreciated.
>
>
> Thanks
> Krishnan
>
>

Mime
View raw message