<?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 [resolved] Convert AD timestamp to date string in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-AD-timestamp-to-date-string/m-p/2209861#M8510</link>
    <description>Can anyone point me in the right direction to convert an AD timestamp (which is a numeric string stored as the number of 100ns periods since 1/1/1600, the lastLogon value) to a date string, I'm doing this in a tmap 
&lt;BR /&gt;I have lastLogon=129052436323349513 and want "2012/01/01 14:00:00" (No, that isn't the right string for that lastLogon value, but that's the format I want.) 
&lt;BR /&gt;I have just spent the last 3 hours frustratedly googling for help and can't find anything that doesn't seem to require a lot more java knowledge than I have, as I'm reasonably adept at Talend but a complete newby wrt to java programming. 
&lt;BR /&gt;I was hoping to do something like: 
&lt;BR /&gt;TalendDate.formatDate("yyyy-MM-dd HH:mm:ss", TalendDate.addDate(TalendDate.parseDate("yyyy/MM/dd HH:mm:ss", "1970/01/01 00:00:00), (Long.valueOf(Var.var9).longValue())/10000000-109207*24*3600,"ss")) 
&lt;BR /&gt;Which I think would be right except TalendDate.addDate only wants an int, not a long. 
&lt;BR /&gt;Happy to learn, but currently ready to throw my laptop through a window. 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt;</description>
    <pubDate>Wed, 19 Dec 2012 02:49:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-12-19T02:49:28Z</dc:date>
    <item>
      <title>[resolved] Convert AD timestamp to date string</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-AD-timestamp-to-date-string/m-p/2209861#M8510</link>
      <description>Can anyone point me in the right direction to convert an AD timestamp (which is a numeric string stored as the number of 100ns periods since 1/1/1600, the lastLogon value) to a date string, I'm doing this in a tmap 
&lt;BR /&gt;I have lastLogon=129052436323349513 and want "2012/01/01 14:00:00" (No, that isn't the right string for that lastLogon value, but that's the format I want.) 
&lt;BR /&gt;I have just spent the last 3 hours frustratedly googling for help and can't find anything that doesn't seem to require a lot more java knowledge than I have, as I'm reasonably adept at Talend but a complete newby wrt to java programming. 
&lt;BR /&gt;I was hoping to do something like: 
&lt;BR /&gt;TalendDate.formatDate("yyyy-MM-dd HH:mm:ss", TalendDate.addDate(TalendDate.parseDate("yyyy/MM/dd HH:mm:ss", "1970/01/01 00:00:00), (Long.valueOf(Var.var9).longValue())/10000000-109207*24*3600,"ss")) 
&lt;BR /&gt;Which I think would be right except TalendDate.addDate only wants an int, not a long. 
&lt;BR /&gt;Happy to learn, but currently ready to throw my laptop through a window. 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Wed, 19 Dec 2012 02:49:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-AD-timestamp-to-date-string/m-p/2209861#M8510</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-12-19T02:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Convert AD timestamp to date string</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-AD-timestamp-to-date-string/m-p/2209862#M8511</link>
      <description>I found a solution, and learned something new about java dates. 
&lt;BR /&gt;My tmap now has: new Date(TalendDate.parseDate("yyyy/MM/dd", "1970/01/01").getTime() +(Long.valueOf(row1.lastLogon).longValue()/10000-11644473600000L+36000000L)) 
&lt;BR /&gt;10000 to convert 100ns time intervals to milliseconds, 11644473600000L as the number of milliseconds between 1/1/1601 and 1/1/1970 (wolfram alpha says 134774 days, which is 11,644,473,600s) and the 36000000L (10 hours in milliseconds) to correct for my timezone. 
&lt;BR /&gt;The output values agree with AD</description>
      <pubDate>Wed, 19 Dec 2012 04:08:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-AD-timestamp-to-date-string/m-p/2209862#M8511</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-12-19T04:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Convert AD timestamp to date string</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-AD-timestamp-to-date-string/m-p/2209863#M8512</link>
      <description>Hi magpac &lt;BR /&gt;Just want to let you know that you saved me alot of time by providing your solution&lt;BR /&gt;So I am very gratefull thanks!&lt;BR /&gt;Started to get frustrated and then came across this.&lt;BR /&gt;Regards,</description>
      <pubDate>Mon, 07 Jan 2013 13:46:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-AD-timestamp-to-date-string/m-p/2209863#M8512</guid>
      <dc:creator>Spretorius</dc:creator>
      <dc:date>2013-01-07T13:46:53Z</dc:date>
    </item>
  </channel>
</rss>

