<?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>topic How to use TalendDate.parseDate() to convert from string to date in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-TalendDate-parseDate-to-convert-from-string-to-date/m-p/2305245#M76929</link>
    <description>Hi,
&lt;BR /&gt;I have a date(String data type) column in mysql table , values are in 2 formates 'yyyyMMdd_hhmmssSSS' and 'yyyy-MM-dd hh:mm:ss'.
&lt;BR /&gt;I can convert this string type to date using TalendDate.parseDate("yyyyMMdd_hhmmssSSS",row1.date);
&lt;BR /&gt;this conversion i am using inside a tMap component. My question is How to use TalendDate.parseDate() for both the date formates at once?
&lt;BR /&gt;Right now I am getting unparsable date formate error since I am not handling this 'yyyy-MM-dd hh:mm:ss' format. Please help.
&lt;BR /&gt;Thanks&amp;nbsp;</description>
    <pubDate>Fri, 21 Aug 2015 08:30:08 GMT</pubDate>
    <dc:creator>_AnonymousUser</dc:creator>
    <dc:date>2015-08-21T08:30:08Z</dc:date>
    <item>
      <title>How to use TalendDate.parseDate() to convert from string to date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-TalendDate-parseDate-to-convert-from-string-to-date/m-p/2305245#M76929</link>
      <description>Hi,
&lt;BR /&gt;I have a date(String data type) column in mysql table , values are in 2 formates 'yyyyMMdd_hhmmssSSS' and 'yyyy-MM-dd hh:mm:ss'.
&lt;BR /&gt;I can convert this string type to date using TalendDate.parseDate("yyyyMMdd_hhmmssSSS",row1.date);
&lt;BR /&gt;this conversion i am using inside a tMap component. My question is How to use TalendDate.parseDate() for both the date formates at once?
&lt;BR /&gt;Right now I am getting unparsable date formate error since I am not handling this 'yyyy-MM-dd hh:mm:ss' format. Please help.
&lt;BR /&gt;Thanks&amp;nbsp;</description>
      <pubDate>Fri, 21 Aug 2015 08:30:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-use-TalendDate-parseDate-to-convert-from-string-to-date/m-p/2305245#M76929</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2015-08-21T08:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to use TalendDate.parseDate() to convert from string to date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-TalendDate-parseDate-to-convert-from-string-to-date/m-p/2305246#M76930</link>
      <description>If understood correctly you have a column called row1.date which has two different type of dates, in single column?&amp;nbsp; 
&lt;BR /&gt;then you can do it in following way.&amp;nbsp; 
&lt;BR /&gt; 
&lt;PRE&gt;row1.date.contains("_")? TalendDate.parseDate("yyyyMMdd_hhmmssSSS",row1.date):&amp;nbsp;row1.date.contains(":")? TalendDate.parseDate("yyyy-MM-dd hh:mm:ss",row1.date):TalendDate.getDate()&lt;/PRE&gt; 
&lt;BR /&gt;Try this one or you can check more date formats on 
&lt;A href="http://dwetl.com/2015/04/28/talend-date-routine-function-with-examples/" target="_blank" rel="nofollow noopener noreferrer"&gt;talend-date-routine-function-with-examples&lt;/A&gt;</description>
      <pubDate>Fri, 21 Aug 2015 09:18:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-use-TalendDate-parseDate-to-convert-from-string-to-date/m-p/2305246#M76930</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-21T09:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to use TalendDate.parseDate() to convert from string to date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-TalendDate-parseDate-to-convert-from-string-to-date/m-p/2305247#M76931</link>
      <description>Thank You. I will try this.</description>
      <pubDate>Fri, 21 Aug 2015 10:38:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-use-TalendDate-parseDate-to-convert-from-string-to-date/m-p/2305247#M76931</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2015-08-21T10:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to use TalendDate.parseDate() to convert from string to date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-TalendDate-parseDate-to-convert-from-string-to-date/m-p/2305248#M76932</link>
      <description>Thank you so much. Problem resolved. This worked perfectly.</description>
      <pubDate>Mon, 24 Aug 2015 06:31:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-use-TalendDate-parseDate-to-convert-from-string-to-date/m-p/2305248#M76932</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2015-08-24T06:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to use TalendDate.parseDate() to convert from string to date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-TalendDate-parseDate-to-convert-from-string-to-date/m-p/2305249#M76933</link>
      <description>Happy to see it works.. you can now closed this topic, mark it Resolve.</description>
      <pubDate>Mon, 24 Aug 2015 07:29:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-use-TalendDate-parseDate-to-convert-from-string-to-date/m-p/2305249#M76933</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-24T07:29:19Z</dc:date>
    </item>
  </channel>
</rss>

