<?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: now() does not generate current timestamp in load script in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/now-does-not-generate-current-timestamp-in-load-script/m-p/2462761#M98993</link>
    <description>&lt;P&gt;Hi, the default returns the last finished data load, try with Now(1):&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/qlikview/May2024/Subsystems/Client/Content/QV_QlikView/Scripting/DateAndTimeFunctions/now.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/May2024/Subsystems/Client/Content/QV_QlikView/Scripting/DateAndTimeFunctions/now.htm&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 15 Jun 2024 14:28:10 GMT</pubDate>
    <dc:creator>rubenmarin</dc:creator>
    <dc:date>2024-06-15T14:28:10Z</dc:date>
    <item>
      <title>now() does not generate current timestamp in load script</title>
      <link>https://community.qlik.com/t5/App-Development/now-does-not-generate-current-timestamp-in-load-script/m-p/2462760#M98992</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to generate a UNIX timestamp with the now() function that needs to be used in a API call.&amp;nbsp;I need to generate the UNIX timestamp at the moment of calling the API endpoint.&lt;/P&gt;
&lt;P&gt;Therefore I use:&amp;nbsp;let vtimestamp = Floor(now()-MakeDate(1970,1,1))*86400;&lt;/P&gt;
&lt;P&gt;However, it is not working as expected. At this moment, it returns for example '1718409600', while the current timestamp is&amp;nbsp;1718458763. Even when I refresh the page and run the script again, it still returns an old value.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there some reason why I do not get the current timestamp?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards, Sterre&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 11:48:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/now-does-not-generate-current-timestamp-in-load-script/m-p/2462760#M98992</guid>
      <dc:creator>SterreKapteijns</dc:creator>
      <dc:date>2024-06-17T11:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: now() does not generate current timestamp in load script</title>
      <link>https://community.qlik.com/t5/App-Development/now-does-not-generate-current-timestamp-in-load-script/m-p/2462761#M98993</link>
      <description>&lt;P&gt;Hi, the default returns the last finished data load, try with Now(1):&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/qlikview/May2024/Subsystems/Client/Content/QV_QlikView/Scripting/DateAndTimeFunctions/now.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/May2024/Subsystems/Client/Content/QV_QlikView/Scripting/DateAndTimeFunctions/now.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jun 2024 14:28:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/now-does-not-generate-current-timestamp-in-load-script/m-p/2462761#M98993</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2024-06-15T14:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: now() does not generate current timestamp in load script</title>
      <link>https://community.qlik.com/t5/App-Development/now-does-not-generate-current-timestamp-in-load-script/m-p/2462968#M98999</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried using Now(1), but I still get an 'old' timestamp.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sterre&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 10:37:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/now-does-not-generate-current-timestamp-in-load-script/m-p/2462968#M98999</guid>
      <dc:creator>SterreKapteijns</dc:creator>
      <dc:date>2024-06-17T10:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: now() does not generate current timestamp in load script</title>
      <link>https://community.qlik.com/t5/App-Development/now-does-not-generate-current-timestamp-in-load-script/m-p/2462980#M99000</link>
      <description>&lt;P&gt;I am a tad confused. Why would the timestamp created during the reload script change when you open or refresh the app? Opening or refreshing the app does not run the reload script...&lt;/P&gt;
&lt;P&gt;If that's what you're after, you can use the variable editor to create an on-the-fly variable rather than creating it in your script.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 11:12:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/now-does-not-generate-current-timestamp-in-load-script/m-p/2462980#M99000</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2024-06-17T11:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: now() does not generate current timestamp in load script</title>
      <link>https://community.qlik.com/t5/App-Development/now-does-not-generate-current-timestamp-in-load-script/m-p/2462983#M99001</link>
      <description>&lt;P&gt;As the linked help page states:&lt;/P&gt;
&lt;TABLE class="TableStyle-tableGrid" cellspacing="0"&gt;
&lt;TBODY&gt;
&lt;TR class="Body-Body1"&gt;
&lt;TD class="BodyI--"&gt;
&lt;P&gt;&lt;SPAN class="Code" data-mc-conditions="Targets.NotToTranslate"&gt;now( 1)&lt;/SPAN&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD class="BodyG--"&gt;
&lt;UL&gt;
&lt;LI&gt;When used in a chart expression, this returns the time of the function call.&lt;/LI&gt;
&lt;LI&gt;When used in a load script, this returns the time of the function call in the current data load.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Mon, 17 Jun 2024 11:23:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/now-does-not-generate-current-timestamp-in-load-script/m-p/2462983#M99001</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2024-06-17T11:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: now() does not generate current timestamp in load script</title>
      <link>https://community.qlik.com/t5/App-Development/now-does-not-generate-current-timestamp-in-load-script/m-p/2462986#M99002</link>
      <description>&lt;P&gt;I need the variable in the API call, therefore creating the on-the-fly variable would no be possible right?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 11:34:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/now-does-not-generate-current-timestamp-in-load-script/m-p/2462986#M99002</guid>
      <dc:creator>SterreKapteijns</dc:creator>
      <dc:date>2024-06-17T11:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: now() does not generate current timestamp in load script</title>
      <link>https://community.qlik.com/t5/App-Development/now-does-not-generate-current-timestamp-in-load-script/m-p/2462987#M99003</link>
      <description>&lt;P&gt;Yeah I have read the documentation, however it does not work as described. The function is called in the load script, however it does not return the time the function is called during the data load.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 11:36:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/now-does-not-generate-current-timestamp-in-load-script/m-p/2462987#M99003</guid>
      <dc:creator>SterreKapteijns</dc:creator>
      <dc:date>2024-06-17T11:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: now() does not generate current timestamp in load script</title>
      <link>https://community.qlik.com/t5/App-Development/now-does-not-generate-current-timestamp-in-load-script/m-p/2462990#M99005</link>
      <description>&lt;P&gt;If you're making the API call from script, then you would indeed want to use a script variable, but - that variable doesn't change when you open the app, only when the script is run.&lt;/P&gt;
&lt;P&gt;I'd also suggest using today(1) rather than Now(1), since you seem to be floor()ing away the time aspect anyway, but that shouldn't impact the result, just cleaner to read.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 11:45:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/now-does-not-generate-current-timestamp-in-load-script/m-p/2462990#M99005</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2024-06-17T11:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: now() does not generate current timestamp in load script</title>
      <link>https://community.qlik.com/t5/App-Development/now-does-not-generate-current-timestamp-in-load-script/m-p/2462991#M99006</link>
      <description>&lt;P&gt;Of course I run the script, but then the function will still not return the current timestamp.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Furthermore, I need the timestamp, not the date and today(1) will return the date.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 11:50:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/now-does-not-generate-current-timestamp-in-load-script/m-p/2462991#M99006</guid>
      <dc:creator>SterreKapteijns</dc:creator>
      <dc:date>2024-06-17T11:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: now() does not generate current timestamp in load script</title>
      <link>https://community.qlik.com/t5/App-Development/now-does-not-generate-current-timestamp-in-load-script/m-p/2462995#M99007</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/215914"&gt;@SterreKapteijns&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Of course I run the script, but then the function will still not return the current timestamp.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Furthermore, I need the timestamp, not the date and today(1) will return the date.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Even more confused now. If you need the timestamp, why are you floor()ing?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Or_0-1718625192298.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/168016i8382ACD0B71BB65E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Or_0-1718625192298.png" alt="Or_0-1718625192298.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you perchance intend to floor() outside of the multiplication by seconds?&lt;/P&gt;
&lt;P&gt;Floor((now()-MakeDate(1970,1,1))*86400)&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 11:54:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/now-does-not-generate-current-timestamp-in-load-script/m-p/2462995#M99007</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2024-06-17T11:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: now() does not generate current timestamp in load script</title>
      <link>https://community.qlik.com/t5/App-Development/now-does-not-generate-current-timestamp-in-load-script/m-p/2463016#M99009</link>
      <description>&lt;P&gt;Yeah I was, small typo. Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 12:57:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/now-does-not-generate-current-timestamp-in-load-script/m-p/2463016#M99009</guid>
      <dc:creator>SterreKapteijns</dc:creator>
      <dc:date>2024-06-17T12:57:53Z</dc:date>
    </item>
  </channel>
</rss>

