Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive >> mail # user >> Fwd: Need help in Date format


Copy link to this message
-
Fwd: Need help in Date format
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

 
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB