<?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 Date format changes before storing as global variable in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Date-format-changes-before-storing-as-global-variable/m-p/2362035#M126244</link>
    <description>I have a tExtractRegexField which looks for a Date string like 
&lt;BR /&gt; 
&lt;PRE&gt;&amp;nbsp;"(\\d{2}-\\D{3}-\\d{2})"&lt;/PRE&gt; 
&lt;BR /&gt; so it will find dates like 01-Feb-16 a.k.a&amp;nbsp;"dd-MMM-yyyy" 
&lt;BR /&gt;That works but I need to store the date in globalmap so I add a tJavaRow as the next component 
&lt;BR /&gt; 
&lt;PRE&gt;globalMap.put("MyDate", row3.ReportDate);&lt;/PRE&gt; 
&lt;BR /&gt;In debugging mode I can see the ReportDate as "DayOfWeek MonthAsString DayAsNumber 00:00:00 TimeZone Year" 
&lt;BR /&gt;Is there a way to specify the date format as "dd-MMM-yyyy" as the way to store the date in the globalmap</description>
    <pubDate>Tue, 04 Apr 2017 15:59:42 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-04-04T15:59:42Z</dc:date>
    <item>
      <title>Date format changes before storing as global variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Date-format-changes-before-storing-as-global-variable/m-p/2362035#M126244</link>
      <description>I have a tExtractRegexField which looks for a Date string like 
&lt;BR /&gt; 
&lt;PRE&gt;&amp;nbsp;"(\\d{2}-\\D{3}-\\d{2})"&lt;/PRE&gt; 
&lt;BR /&gt; so it will find dates like 01-Feb-16 a.k.a&amp;nbsp;"dd-MMM-yyyy" 
&lt;BR /&gt;That works but I need to store the date in globalmap so I add a tJavaRow as the next component 
&lt;BR /&gt; 
&lt;PRE&gt;globalMap.put("MyDate", row3.ReportDate);&lt;/PRE&gt; 
&lt;BR /&gt;In debugging mode I can see the ReportDate as "DayOfWeek MonthAsString DayAsNumber 00:00:00 TimeZone Year" 
&lt;BR /&gt;Is there a way to specify the date format as "dd-MMM-yyyy" as the way to store the date in the globalmap</description>
      <pubDate>Tue, 04 Apr 2017 15:59:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Date-format-changes-before-storing-as-global-variable/m-p/2362035#M126244</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-04T15:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: Date format changes before storing as global variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Date-format-changes-before-storing-as-global-variable/m-p/2362036#M126245</link>
      <description>You can convert it to a string before you store it, but then you lose the flexibility of the date format. &amp;nbsp;You could also convert it to a string with a specific format before printing it.</description>
      <pubDate>Tue, 04 Apr 2017 16:27:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Date-format-changes-before-storing-as-global-variable/m-p/2362036#M126245</guid>
      <dc:creator>cterenzi</dc:creator>
      <dc:date>2017-04-04T16:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Date format changes before storing as global variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Date-format-changes-before-storing-as-global-variable/m-p/2362037#M126246</link>
      <description>Try this as the field seems to be of String datatype:
&lt;BR /&gt;
&lt;PRE&gt;globalMap.put("MyDate", StingHandling.LEFT(row3.ReportDate, 11));&lt;/PRE&gt;
&lt;BR /&gt;
&lt;FONT size="2"&gt;It should works.&lt;/FONT&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;
&lt;BR /&gt;
&lt;FONT size="2"&gt;TRF&lt;/FONT&gt;</description>
      <pubDate>Tue, 04 Apr 2017 16:38:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Date-format-changes-before-storing-as-global-variable/m-p/2362037#M126246</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-04-04T16:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Date format changes before storing as global variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Date-format-changes-before-storing-as-global-variable/m-p/2362038#M126247</link>
      <description>Does stringhandling.left just take the 11 chars from the left? 
&lt;BR /&gt;I'd prefer to store it as dd-MMM-yy in string or date format as I can parse it easily enough in tMap. I was a bit surprised the formatting changed as I had the output schema defined as date dd/mmm/yy but at least I know its getting detected as a date 
&lt;BR /&gt;How would I re-enforce the required structure on the string I store in&amp;nbsp; 
&lt;FONT size="2"&gt;&lt;FONT face="consolas, monaco, " bitstream="" vera="" sans="" mono=""&gt;globalMap.put("MyDate", row3.ReportDate); &lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt;Java isn't my strong point</description>
      <pubDate>Tue, 04 Apr 2017 17:49:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Date-format-changes-before-storing-as-global-variable/m-p/2362038#M126247</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-04T17:49:52Z</dc:date>
    </item>
  </channel>
</rss>

