I'd try avoid using the Hive inbuilt from_unixtime and unix_timestamp functions. They are buggy, in that they depend on the cluster's timezone. So if some of your cluster nodes have a different timezone than others, these functions suffer.
Right now, for what you want, it probably doesn't matter. But I'm just saying in general. BTW, Joda Time also has provisions to set/convert timezones :) On Thu, Jun 12, 2014 at 8:34 PM, Krishnan Narayanan < krishnan.sm...@gmail.com> wrote: > Thank you very much it worked. > > > On Thu, Jun 12, 2014 at 5:21 PM, Gabriel Eisbruch < > gabrieleisbr...@gmail.com> wrote: > >> 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.sm...@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 >>> >>> >> >