<?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 Re: Transform a time into seconds in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Transform-a-time-into-seconds/m-p/2333522#M102298</link>
    <description>It's in TOS too, at least for java projects.</description>
    <pubDate>Wed, 07 Oct 2009 03:24:45 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-10-07T03:24:45Z</dc:date>
    <item>
      <title>Transform a time into seconds</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transform-a-time-into-seconds/m-p/2333517#M102293</link>
      <description>Hi!
&lt;BR /&gt;I am trying in the tMap to transform a time that I get out from a data source in string like this "12:13:55" to seconds (43200 + 720 + 55 = 43975) in this case.
&lt;BR /&gt;How can I do that with the expressions given to me in the tMap Expressions?
&lt;BR /&gt;Thanks
&lt;BR /&gt;Joakim</description>
      <pubDate>Sat, 16 Nov 2024 13:44:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transform-a-time-into-seconds/m-p/2333517#M102293</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2024-11-16T13:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Transform a time into seconds</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transform-a-time-into-seconds/m-p/2333518#M102294</link>
      <description>Hi,&lt;BR /&gt;Create a routine :-&lt;BR /&gt;	public static String CalculateTotalSeconds(String timein) {&lt;BR /&gt;		String[] date_string = timein.split(":");&lt;BR /&gt;		int hours = Integer.parseInt(date_string);&lt;BR /&gt;		int mins = Integer.parseInt(date_string);&lt;BR /&gt;		int seconds = Integer.parseInt(date_string);&lt;BR /&gt;		&lt;BR /&gt;		int totalsec = (hours * 3600)+ (mins* 60) + seconds;&lt;BR /&gt;        &lt;BR /&gt;		return "" + totalsec;&lt;BR /&gt;	} &lt;BR /&gt;Call from tmap :-&lt;BR /&gt;Date_Converter.CalculateTotalSeconds(variable); &lt;BR /&gt;Returns a string with total seconds.&lt;BR /&gt;HTH</description>
      <pubDate>Tue, 06 Oct 2009 00:10:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transform-a-time-into-seconds/m-p/2333518#M102294</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-06T00:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: Transform a time into seconds</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transform-a-time-into-seconds/m-p/2333519#M102295</link>
      <description>tnewman: Thanks for the example. I just don´t know how to create a routine, I am in the Navigator mode of the Repository but I dont understand how to create it.
&lt;BR /&gt;// Joakim</description>
      <pubDate>Tue, 06 Oct 2009 10:08:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transform-a-time-into-seconds/m-p/2333519#M102295</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2009-10-06T10:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: Transform a time into seconds</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transform-a-time-into-seconds/m-p/2333520#M102296</link>
      <description>I dont have the "code" section in my Repository that is shown on examples I have seen... How do I get that visible?</description>
      <pubDate>Tue, 06 Oct 2009 10:25:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transform-a-time-into-seconds/m-p/2333520#M102296</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2009-10-06T10:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Transform a time into seconds</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transform-a-time-into-seconds/m-p/2333521#M102297</link>
      <description>Hi,
&lt;BR /&gt;I am using TIS and I see the Code branch in the standard view. I have looked around the various menus and cannot see anywhere we you can include/exclude from the repo view.
&lt;BR /&gt;I am not sure if TOS is different.
&lt;BR /&gt;Sorry I can't be much more help - maybe someone else can answer.</description>
      <pubDate>Tue, 06 Oct 2009 21:41:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transform-a-time-into-seconds/m-p/2333521#M102297</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-06T21:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: Transform a time into seconds</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transform-a-time-into-seconds/m-p/2333522#M102298</link>
      <description>It's in TOS too, at least for java projects.</description>
      <pubDate>Wed, 07 Oct 2009 03:24:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transform-a-time-into-seconds/m-p/2333522#M102298</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-07T03:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: Transform a time into seconds</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transform-a-time-into-seconds/m-p/2333523#M102299</link>
      <description>&lt;P&gt;Got an error when creating routine&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 543px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M34s.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/139658i7D5F7B0CF1BCFB44/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M34s.png" alt="0683p000009M34s.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 20:34:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transform-a-time-into-seconds/m-p/2333523#M102299</guid>
      <dc:creator>Karuetl</dc:creator>
      <dc:date>2019-02-12T20:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: Transform a time into seconds</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transform-a-time-into-seconds/m-p/2333524#M102300</link>
      <description>&lt;BLOCKQUOTE&gt; 
 &lt;HR /&gt; 
 &lt;A href="https://community.qlik.com/s/profile/0053p000007LMjvAAG"&gt;@Karuetl&lt;/A&gt;&amp;nbsp;wrote: 
 &lt;BR /&gt; 
 &lt;P&gt;Got an error when creating routine&amp;nbsp;&lt;/P&gt; 
 &lt;P&gt;&amp;nbsp;&lt;/P&gt; 
 &lt;HR /&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;P&gt;you just need chose array element for parse&lt;/P&gt; 
&lt;P&gt;0 - hours&lt;/P&gt; 
&lt;P&gt;1 - minutes&lt;/P&gt; 
&lt;P&gt;2 - seconds&lt;/P&gt; 
&lt;PRE&gt;	public static String CalculateTotalSeconds(String timein) {
		String[] date_string = timein.split(":");
		int hours = Integer.parseInt(date_string[0]);
		int mins = Integer.parseInt(date_string[1]);
		int seconds = Integer.parseInt(date_string[2]);

		int totalsec = (hours * 3600)+ (mins* 60) + seconds;

		return "" + totalsec;
		} &lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;P.S.&lt;/P&gt; 
&lt;P&gt;keep in mind - original routine return String, if you need have a long or integer - you need modify it or convert into integer&amp;nbsp;in tMap/tJava&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2019 00:43:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transform-a-time-into-seconds/m-p/2333524#M102300</guid>
      <dc:creator>vapukov</dc:creator>
      <dc:date>2019-02-13T00:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: Transform a time into seconds</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transform-a-time-into-seconds/m-p/2333525#M102301</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2019 00:51:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transform-a-time-into-seconds/m-p/2333525#M102301</guid>
      <dc:creator>Karuetl</dc:creator>
      <dc:date>2019-02-13T00:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: Transform a time into seconds</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transform-a-time-into-seconds/m-p/2333526#M102302</link>
      <description>&lt;P&gt;thanks - it is too much&amp;nbsp; ...&amp;nbsp; kudu is enough &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;welcome to community&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2019 01:27:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transform-a-time-into-seconds/m-p/2333526#M102302</guid>
      <dc:creator>vapukov</dc:creator>
      <dc:date>2019-02-13T01:27:31Z</dc:date>
    </item>
  </channel>
</rss>

