<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Is it me or does NetXMS have time travel capabilities?]]></title><description><![CDATA[<p dir="auto">I have the following hook in my NodeUp and an equivalent in my node down. Apart from it being the longest way of doing this (first one I found when searching), I get a strange result.</p>
<p dir="auto">Everything is correct - except - the month is out by 1. It reports month as being last month, not this month. I know the local time is correct(or bein extracted correctly) because I am comparing the Node_Up and Node_Down event times to the custom attributes - and everything matches  - exactly - except the month - which is out by one.</p>
<p dir="auto">SetCustomAttribute($node, "timelastcameup",localtime(time())-&gt;mday.".".localtime(time())-&gt;mon.".".localtime(time())-&gt;year.", ".localtime(time())-&gt;hour.":".localtime(time())-&gt;min.":".localtime(time())-&gt;sec);</p>
<p dir="auto">Any ideas?</p>
]]></description><link>https://forum.netxms.org/topic/6135/is-it-me-or-does-netxms-have-time-travel-capabilities</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 08:25:57 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/6135.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 25 Aug 2019 22:37:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Is it me or does NetXMS have time travel capabilities? on Thu, 12 Sep 2019 11:33:24 GMT]]></title><description><![CDATA[<p dir="auto">You can simply use strftime (<a href="https://wiki.netxms.org/wiki/NXSL:strftime" rel="nofollow ugc">https://wiki.netxms.org/wiki/NXSL:strftime</a><img src="https://forum.netxms.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=72b86a538fc" class="not-responsive emoji emoji-android emoji--disappointed" style="height:1.4em;width:auto;vertical-align:middle" title="):" alt="😞" /></p>
<pre><code>SetCustomAttribute($node, "timelastcameup", strftime("%d-%m-%Y, %H:%M:%S", $1));
</code></pre>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/26503</link><guid isPermaLink="true">https://forum.netxms.org/post/26503</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Thu, 12 Sep 2019 11:33:24 GMT</pubDate></item><item><title><![CDATA[Reply to Is it me or does NetXMS have time travel capabilities? on Thu, 12 Sep 2019 11:26:05 GMT]]></title><description><![CDATA[<p dir="auto">Tursiops - correct as usual <img src="https://forum.netxms.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=72b86a538fc" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:1.4em;width:auto;vertical-align:middle" title=":)" alt="🙂" /><br />
<a href="https://wiki.netxms.org/wiki/NXSL:TIME" rel="nofollow ugc">https://wiki.netxms.org/wiki/NXSL:TIME</a></p>
<p dir="auto">Would be nice for NXSL TIME to also have mona as the actual month - adding 1 to mon so I don't have to.</p>
<p dir="auto">Adding that within SetCustomAttribute will be fun. Something like one of the following I hope - but probably not that lucky.</p>
<pre><code>SetCustomAttribute($node, "timelastcameup",localtime(time())-&gt;mday.".".((localtime(time())-&gt;mon)+1).".".localtime(time())-&gt;year.", ".localtime(time())-&gt;hour.":".localtime(time())-&gt;min.":".localtime(time())-&gt;sec);
</code></pre>
<p dir="auto">or</p>
<pre><code>SetCustomAttribute($node, "timelastcameup",localtime(time())-&gt;mday.".".localtime(time())-&gt;mon+1.".".localtime(time())-&gt;year.", ".localtime(time())-&gt;hour.":".localtime(time())-&gt;min.":".localtime(time())-&gt;sec);
</code></pre>
<p dir="auto">Or going the long way:</p>
<pre><code>day = localtime($1)-&gt;mday;

mon = localtime($1)-&gt;mon+1;

year = localtime($1)-&gt;year;

hour = localtime($1)-&gt;hour;

min = localtime($1)-&gt;min;

SetCustomAttribute($node, "timelastcameup", day."-".mon."-".year.",".hour.":".min;
</code></pre>
<p dir="auto">One of these should work.</p>
]]></description><link>https://forum.netxms.org/post/26502</link><guid isPermaLink="true">https://forum.netxms.org/post/26502</guid><dc:creator><![CDATA[paul]]></dc:creator><pubDate>Thu, 12 Sep 2019 11:26:05 GMT</pubDate></item><item><title><![CDATA[Reply to Is it me or does NetXMS have time travel capabilities? on Mon, 26 Aug 2019 03:17:08 GMT]]></title><description><![CDATA[<p dir="auto">As per <a href="http://www.cplusplus.com/reference/ctime/tm/" rel="nofollow ugc">http://www.cplusplus.com/reference/ctime/tm/</a>, I believe months are "months since January" and therefore go from 0-11, not 1-12.</p>
]]></description><link>https://forum.netxms.org/post/26380</link><guid isPermaLink="true">https://forum.netxms.org/post/26380</guid><dc:creator><![CDATA[Tursiops]]></dc:creator><pubDate>Mon, 26 Aug 2019 03:17:08 GMT</pubDate></item></channel></rss>