<?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 Declare a date constant in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Declare-a-date-constant/m-p/2304468#M76238</link>
    <description>I have defined a Repository Context Variable as a Date datatype -- I intend to use this Context Variable in multiple jobs.&lt;BR /&gt;I am looking for the correct Java syntax to set this Date-type variable, but I don't know the syntax to set a date constant.&lt;BR /&gt;&lt;PRE&gt;varCutoffDate = "2006-01-01" ;&lt;/PRE&gt;&lt;BR /&gt;The above code throws the error "cannot convert string to date"&lt;BR /&gt;How do I set a date variable in a tJava component?</description>
    <pubDate>Sat, 16 Nov 2024 14:02:19 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T14:02:19Z</dc:date>
    <item>
      <title>Declare a date constant</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Declare-a-date-constant/m-p/2304468#M76238</link>
      <description>I have defined a Repository Context Variable as a Date datatype -- I intend to use this Context Variable in multiple jobs.&lt;BR /&gt;I am looking for the correct Java syntax to set this Date-type variable, but I don't know the syntax to set a date constant.&lt;BR /&gt;&lt;PRE&gt;varCutoffDate = "2006-01-01" ;&lt;/PRE&gt;&lt;BR /&gt;The above code throws the error "cannot convert string to date"&lt;BR /&gt;How do I set a date variable in a tJava component?</description>
      <pubDate>Sat, 16 Nov 2024 14:02:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Declare-a-date-constant/m-p/2304468#M76238</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T14:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Declare a date constant</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Declare-a-date-constant/m-p/2304469#M76239</link>
      <description>Hello
&lt;BR /&gt;You need to parse the string to Date using the method:TalendDate.parseDate(String pattern, String dateString) provided by Talend.
&lt;BR /&gt;
&lt;PRE&gt;context.date=TalendDate.parseDate("yyyy-MM-dd","2006-01-01");&lt;/PRE&gt;
&lt;BR /&gt;Here date is the variable name, and its data type is Date.
&lt;BR /&gt;Best regards
&lt;BR /&gt; 
&lt;BR /&gt; shong</description>
      <pubDate>Tue, 17 Mar 2009 01:58:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Declare-a-date-constant/m-p/2304469#M76239</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-03-17T01:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: Declare a date constant</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Declare-a-date-constant/m-p/2304470#M76240</link>
      <description>could anybody tell me how to parse a string in a date when you use perl instead of java</description>
      <pubDate>Tue, 17 Mar 2009 15:11:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Declare-a-date-constant/m-p/2304470#M76240</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2009-03-17T15:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: Declare a date constant</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Declare-a-date-constant/m-p/2304471#M76241</link>
      <description>Hi,&lt;BR /&gt;what would you like to do? Perl is (nearly) typeless so you do not have to parse dates.&lt;BR /&gt;Bye&lt;BR /&gt;Volker</description>
      <pubDate>Tue, 17 Mar 2009 19:37:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Declare-a-date-constant/m-p/2304471#M76241</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-03-17T19:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: Declare a date constant</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Declare-a-date-constant/m-p/2304472#M76242</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;You need to parse the string to Date using the method:TalendDate.parseDate(String pattern, String dateString) provided by Talend.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;Thanks.  I discovered this method for declaring date constants:&lt;BR /&gt;&lt;PRE&gt;SimpleDateFormat sdf = new SimpleDateFormat ( "yyyy-MM-dd" ) ;&lt;BR /&gt;context.varCutoffDate = sdf.parse("2006-01-01") ;&lt;/PRE&gt;&lt;BR /&gt;... but the Talend function should make it easier.</description>
      <pubDate>Fri, 20 Mar 2009 21:14:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Declare-a-date-constant/m-p/2304472#M76242</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-03-20T21:14:36Z</dc:date>
    </item>
  </channel>
</rss>

