<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: how to convert a date from different  format to one particular formate in hive? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-convert-a-date-from-different-format-to-one/m-p/170262#M50056</link>
    <description>&lt;P&gt;this looks a timestamp not date, you can store this as string in hive table and retrive it using to_date() funtion,&lt;/P&gt;&lt;P&gt;or you can run some date transformation before inserting into hive table, it looks you are having RFC822 timestamp which you can convert into some hive known transformation like this, I am using a java program to &lt;/P&gt;&lt;PRE&gt;public class RFC822TimeStampConverter {
    public static void main(String[] args) {
        String rfcDate = "Tue, Dec 20 10:04:31 2016";
        String pattern = "EEE, MMM DD HH:mm:ss YYYY";
        SimpleDateFormat format = new SimpleDateFormat(pattern);
        try {
            Date javaDate = format.parse(rfcDate);
            System.out.println(javaDate.toString());
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }
}&lt;/PRE&gt;</description>
    <pubDate>Sat, 24 Dec 2016 16:18:04 GMT</pubDate>
    <dc:creator>rajkumar_singh</dc:creator>
    <dc:date>2016-12-24T16:18:04Z</dc:date>
    <item>
      <title>how to convert a date from different  format to one particular formate in hive?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-convert-a-date-from-different-format-to-one/m-p/170261#M50055</link>
      <description>&lt;P&gt;i have a data in my HDFS,my date format in that file is Tue Dec 20 10:04:31 +0000 2016,when i create a hive table with field name created time and datatype date it store a null value.
how to change that date formate in hive?&lt;/P&gt;</description>
      <pubDate>Sat, 24 Dec 2016 16:15:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-convert-a-date-from-different-format-to-one/m-p/170261#M50055</guid>
      <dc:creator>a_rajeshinfotec</dc:creator>
      <dc:date>2016-12-24T16:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert a date from different  format to one particular formate in hive?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-convert-a-date-from-different-format-to-one/m-p/170262#M50056</link>
      <description>&lt;P&gt;this looks a timestamp not date, you can store this as string in hive table and retrive it using to_date() funtion,&lt;/P&gt;&lt;P&gt;or you can run some date transformation before inserting into hive table, it looks you are having RFC822 timestamp which you can convert into some hive known transformation like this, I am using a java program to &lt;/P&gt;&lt;PRE&gt;public class RFC822TimeStampConverter {
    public static void main(String[] args) {
        String rfcDate = "Tue, Dec 20 10:04:31 2016";
        String pattern = "EEE, MMM DD HH:mm:ss YYYY";
        SimpleDateFormat format = new SimpleDateFormat(pattern);
        try {
            Date javaDate = format.parse(rfcDate);
            System.out.println(javaDate.toString());
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }
}&lt;/PRE&gt;</description>
      <pubDate>Sat, 24 Dec 2016 16:18:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-convert-a-date-from-different-format-to-one/m-p/170262#M50056</guid>
      <dc:creator>rajkumar_singh</dc:creator>
      <dc:date>2016-12-24T16:18:04Z</dc:date>
    </item>
  </channel>
</rss>

