<?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: Hi Folks, Im working on a hive query where i need to convert a string which is a date and its format is : 9/1/2016 11:31:21 AM. I need to convert into another format which looks like this 2016-09-01 11:31:21 AM. Kindly guide and help me in this regard? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hi-Folks-Im-working-on-a-hive-query-where-i-need-to-convert/m-p/146945#M40367</link>
    <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/349/iroberts.html" nodeid="349"&gt;@Ian Roberts&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;I tried the following query which you have suggested but I'm getting very different and weird date. &lt;/P&gt;&lt;P&gt;Select log_source_time, from_unixtime(unix_timestamp((test_date),'mm/dd/yyyy hh:mm:ss a'),'yyyy-mm-dd hh:mm:ss a') as todateformat from table1 limit 2;&lt;/P&gt;&lt;TABLE&gt;
 &lt;TBODY&gt;&lt;TR&gt;
  &lt;TD&gt;&lt;STRONG&gt;log_source_time&lt;/STRONG&gt;&lt;/TD&gt;
  &lt;TD&gt;&lt;STRONG&gt;todateformat&lt;/STRONG&gt;&lt;/TD&gt;
 &lt;/TR&gt;
 &lt;TR&gt;
  &lt;TD&gt;9/1/2016 11:31:21 AM&lt;/TD&gt;
  &lt;TD&gt;2016-31-01 11:31:21 AM&lt;/TD&gt;
 &lt;/TR&gt;
 &lt;TR&gt;
  &lt;TD&gt;9/2/2016 9:59:59 AM&lt;/TD&gt;
  &lt;TD&gt;2016-59-02 09:59:59 AM&lt;/TD&gt;
 &lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
    <pubDate>Mon, 12 Sep 2016 21:32:09 GMT</pubDate>
    <dc:creator>pmayank02</dc:creator>
    <dc:date>2016-09-12T21:32:09Z</dc:date>
    <item>
      <title>Hi Folks, Im working on a hive query where i need to convert a string which is a date and its format is : 9/1/2016 11:31:21 AM. I need to convert into another format which looks like this 2016-09-01 11:31:21 AM. Kindly guide and help me in this regard?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hi-Folks-Im-working-on-a-hive-query-where-i-need-to-convert/m-p/146943#M40365</link>
      <description />
      <pubDate>Mon, 12 Sep 2016 18:31:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hi-Folks-Im-working-on-a-hive-query-where-i-need-to-convert/m-p/146943#M40365</guid>
      <dc:creator>pmayank02</dc:creator>
      <dc:date>2016-09-12T18:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Hi Folks, Im working on a hive query where i need to convert a string which is a date and its format is : 9/1/2016 11:31:21 AM. I need to convert into another format which looks like this 2016-09-01 11:31:21 AM. Kindly guide and help me in this regard?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hi-Folks-Im-working-on-a-hive-query-where-i-need-to-convert/m-p/146944#M40366</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/12361/pmayank02.html" nodeid="12361"&gt;@Mayank Pandey&lt;/A&gt; there are some ways of converting the date.  For example something like select inp_dt, from_unixtime(unix_timestamp(substr(inp_dt,0,11),'dd-MMM-yyyy')) as todateformat from table;&lt;/P&gt;&lt;P&gt;There are several ways to attempt this if you do a google search on your needs.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2016 20:15:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hi-Folks-Im-working-on-a-hive-query-where-i-need-to-convert/m-p/146944#M40366</guid>
      <dc:creator>iroberts</dc:creator>
      <dc:date>2016-09-12T20:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Hi Folks, Im working on a hive query where i need to convert a string which is a date and its format is : 9/1/2016 11:31:21 AM. I need to convert into another format which looks like this 2016-09-01 11:31:21 AM. Kindly guide and help me in this regard?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hi-Folks-Im-working-on-a-hive-query-where-i-need-to-convert/m-p/146945#M40367</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/349/iroberts.html" nodeid="349"&gt;@Ian Roberts&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;I tried the following query which you have suggested but I'm getting very different and weird date. &lt;/P&gt;&lt;P&gt;Select log_source_time, from_unixtime(unix_timestamp((test_date),'mm/dd/yyyy hh:mm:ss a'),'yyyy-mm-dd hh:mm:ss a') as todateformat from table1 limit 2;&lt;/P&gt;&lt;TABLE&gt;
 &lt;TBODY&gt;&lt;TR&gt;
  &lt;TD&gt;&lt;STRONG&gt;log_source_time&lt;/STRONG&gt;&lt;/TD&gt;
  &lt;TD&gt;&lt;STRONG&gt;todateformat&lt;/STRONG&gt;&lt;/TD&gt;
 &lt;/TR&gt;
 &lt;TR&gt;
  &lt;TD&gt;9/1/2016 11:31:21 AM&lt;/TD&gt;
  &lt;TD&gt;2016-31-01 11:31:21 AM&lt;/TD&gt;
 &lt;/TR&gt;
 &lt;TR&gt;
  &lt;TD&gt;9/2/2016 9:59:59 AM&lt;/TD&gt;
  &lt;TD&gt;2016-59-02 09:59:59 AM&lt;/TD&gt;
 &lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 12 Sep 2016 21:32:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hi-Folks-Im-working-on-a-hive-query-where-i-need-to-convert/m-p/146945#M40367</guid>
      <dc:creator>pmayank02</dc:creator>
      <dc:date>2016-09-12T21:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: Hi Folks, Im working on a hive query where i need to convert a string which is a date and its format is : 9/1/2016 11:31:21 AM. I need to convert into another format which looks like this 2016-09-01 11:31:21 AM. Kindly guide and help me in this regard?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hi-Folks-Im-working-on-a-hive-query-where-i-need-to-convert/m-p/146946#M40368</link>
      <description>&lt;P&gt; &lt;A rel="user" href="https://community.cloudera.com/users/12361/pmayank02.html" nodeid="12361"&gt;@Mayank Pandey&lt;/A&gt; what does the following produce?&lt;/P&gt;&lt;P&gt;select log_source_time, from_unixtime(unix_timestamp(substr(log_source_time,0,11),'dd-MMM-yyyy')) as todateformat from table1 limit 2;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2016 21:42:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hi-Folks-Im-working-on-a-hive-query-where-i-need-to-convert/m-p/146946#M40368</guid>
      <dc:creator>iroberts</dc:creator>
      <dc:date>2016-09-12T21:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Hi Folks, Im working on a hive query where i need to convert a string which is a date and its format is : 9/1/2016 11:31:21 AM. I need to convert into another format which looks like this 2016-09-01 11:31:21 AM. Kindly guide and help me in this regard?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hi-Folks-Im-working-on-a-hive-query-where-i-need-to-convert/m-p/146947#M40369</link>
      <description>&lt;P style="margin-left: 20px;"&gt;&lt;A rel="user" href="https://community.cloudera.com/users/349/iroberts.html" nodeid="349"&gt;@Ian Roberts&lt;/A&gt; the above query gave the todateformat output as NULL. &lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2016 21:47:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hi-Folks-Im-working-on-a-hive-query-where-i-need-to-convert/m-p/146947#M40369</guid>
      <dc:creator>pmayank02</dc:creator>
      <dc:date>2016-09-12T21:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: Hi Folks, Im working on a hive query where i need to convert a string which is a date and its format is : 9/1/2016 11:31:21 AM. I need to convert into another format which looks like this 2016-09-01 11:31:21 AM. Kindly guide and help me in this regard?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hi-Folks-Im-working-on-a-hive-query-where-i-need-to-convert/m-p/146948#M40370</link>
      <description>&lt;P&gt;oops, your input is slashes, not dashes.  Can you try with the needed format?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2016 22:14:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hi-Folks-Im-working-on-a-hive-query-where-i-need-to-convert/m-p/146948#M40370</guid>
      <dc:creator>iroberts</dc:creator>
      <dc:date>2016-09-12T22:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Hi Folks, Im working on a hive query where i need to convert a string which is a date and its format is : 9/1/2016 11:31:21 AM. I need to convert into another format which looks like this 2016-09-01 11:31:21 AM. Kindly guide and help me in this regard?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hi-Folks-Im-working-on-a-hive-query-where-i-need-to-convert/m-p/146949#M40371</link>
      <description>&lt;P&gt;you have to specify MM for the month. 'mm' is for the minutes.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2016 23:22:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hi-Folks-Im-working-on-a-hive-query-where-i-need-to-convert/m-p/146949#M40371</guid>
      <dc:creator>njayakumar</dc:creator>
      <dc:date>2016-09-12T23:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Hi Folks, Im working on a hive query where i need to convert a string which is a date and its format is : 9/1/2016 11:31:21 AM. I need to convert into another format which looks like this 2016-09-01 11:31:21 AM. Kindly guide and help me in this regard?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hi-Folks-Im-working-on-a-hive-query-where-i-need-to-convert/m-p/146950#M40372</link>
      <description>&lt;P style="margin-left: 40px;"&gt;&lt;A rel="user" href="https://community.cloudera.com/users/12353/njayakumar.html" nodeid="12353"&gt;@njayakumar&lt;/A&gt; the solution provided by you has worked. Thank a ton &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2016 12:25:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hi-Folks-Im-working-on-a-hive-query-where-i-need-to-convert/m-p/146950#M40372</guid>
      <dc:creator>pmayank02</dc:creator>
      <dc:date>2016-09-13T12:25:31Z</dc:date>
    </item>
  </channel>
</rss>

