<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/12985" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2007-01-20T14:11:21-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/12985</id>

		<entry>
		<author><name><![CDATA[heman]]></name></author>
		<updated>2007-01-20T14:11:21-04:00</updated>

		<published>2007-01-20T14:11:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=69766#p69766</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=69766#p69766"/>
		<title type="html"><![CDATA[error calculating datetime]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=69766#p69766"><![CDATA[
Any idea how i can insert that into the script?<br><br>script us <br><div class="codebox"><p>Code: </p><pre><code>set data [mysqlsel $db "select *,SEC_TO_TIME(unix_timestamp(now()) - unix_timestamp(pretime)) as data from $table WHERE nick like '%$keyed%' GROUP BY data;" -list]</code></pre></div>to calculate the time difference between addtime and time now.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8556">heman</a> — Sat Jan 20, 2007 2:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2007-01-20T10:55:28-04:00</updated>

		<published>2007-01-20T10:55:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=69759#p69759</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=69759#p69759"/>
		<title type="html"><![CDATA[error calculating datetime]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=69759#p69759"><![CDATA[
To calculate the time difference between addtime and time now, use:<div class="codebox"><p>Code: </p><pre><code>duration [expr {[unixtime]-[clock scan &lt;addtime&gt;]}]</code></pre></div>example:<blockquote class="uncited"><div>.tcl duration [expr {[unixtime]-[clock scan "2007-01-17 20:11:43"]}]<br>Tcl: 2 days 20 hours 42 minutes 50 seconds</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sat Jan 20, 2007 10:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[heman]]></name></author>
		<updated>2007-01-20T10:39:45-04:00</updated>

		<published>2007-01-20T10:39:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=69757#p69757</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=69757#p69757"/>
		<title type="html"><![CDATA[error calculating datetime]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=69757#p69757"><![CDATA[
While testing the script, i found a problem<br><br>The script I use, stores nicks with date and time in mysql db<br><br>The row, thats stores date now, is called addtime:<br><br>Made it like this: 'addtime datetime'<br><br>This row stores datetime like this<br><blockquote class="uncited"><div>2007-01-17 20:11:43</div></blockquote><br>The script uses:<br><div class="codebox"><p>Code: </p><pre><code>set data [mysqlsel $db "select *,SEC_TO_TIME(unix_timestamp(now()) - unix_timestamp(pretime)) as data from $table WHERE nick like '%$keyed%' GROUP BY data;" -list]</code></pre></div>To calculate time between addtime and time now.<br><br><br>This will result in a output in hours, minutes and seconds. Example: 65:57:17<br><br>So the output looks someting like this:<blockquote class="uncited"><div> DATA -&gt; NICK {2007-01-17 20:11:43} 65:57:17</div></blockquote>In the earlier post (<a href="http://forum.egghelp.org/viewtopic.php?t=12983" class="postlink">http://forum.egghelp.org/viewtopic.php?t=12983</a>)  i asked to change the time output (65:57:17) to seconds, minutes, hours, days etc<br><div class="codebox"><p>Code: </p><pre><code>proc fixTime {daTime} { foreach {h m s} [split $daTime :] {  set unixt [clock scan "$h hours $m minutes $s seconds ago"]  break } duration [expr {[unixtime]-$unixt}]}</code></pre></div>That worked, so it announce in the irc channel someting like this:<blockquote class="uncited"><div>NICK - Added 2 days 17 hours 57 minutes 7 seconds ago</div></blockquote>So everyting works great<br><br><br>But now the problem:<br><br>When a nick is added longer then about  4 weeks 6 days 22 hour 59 minutes and  59 seconds ago (838:59:59), it keeps announcing 4 weeks 6 days 22 hour 59 minutes and  59 seconds (838:59:59)  even if the nick is added longer then that time ago.<br><br>data Examples:<blockquote class="uncited"><div>DATA -&gt; nick1 {2006-11-19 18:46:13} 838:59:59<br>DATA -&gt; nick2 {2006-11-22 01:59:23} 838:59:59<br>DATA -&gt; nick3 {2006-11-27 09:22:19} 838:59:59</div></blockquote>So the addtime is correct, but the calculated time between addtime and now time isnt, it keep telling its 838:59:59 (?)<br><br><br>Any idea what could be the problem?<br><br>Thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8556">heman</a> — Sat Jan 20, 2007 10:39 am</p><hr />
]]></content>
	</entry>
	</feed>
