<?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/12507" />

	<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>2006-10-21T17:08:35-04:00</updated>

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

		<entry>
		<author><name><![CDATA[w00f]]></name></author>
		<updated>2006-10-09T17:32:39-04:00</updated>

		<published>2006-10-09T17:32:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67028#p67028</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67028#p67028"/>
		<title type="html"><![CDATA[[Help] Calculate time [Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67028#p67028"><![CDATA[
tnks man (one more time)<br>I have everything to work now.<br><br>u've been a great help ;D<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8264">w00f</a> — Mon Oct 09, 2006 5:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-10-08T18:59:23-04:00</updated>

		<published>2006-10-08T18:59:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67017#p67017</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67017#p67017"/>
		<title type="html"><![CDATA[[Help] Calculate time [Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67017#p67017"><![CDATA[
clock seconds<br>          Return the current date and time as a system-dependent integer value. The unit of the value is seconds, allowing it to be used for relative time calculations. The value is usually defined as total elapsed time from an ``epoch''. You shouldn't assume the value of the epoch.<br><br>So the [clock seconds] command will produce the current EPOCH time:<br>set now [clock seconds]<br><br>If you're wanting to convert a specific date and time into the EPOCH time, you use:<br>set mytime [clock scan "10/04/06 23:54:41"] <br><br>check the clock manpage for the formats for the date, the command is particular about the format (eg, month day,&lt;comma required&gt; year &lt;time format&gt;)<br><br>Date:<br>The acceptable formats are <br>mm/dd/yy   (10/08/06)<br>monthname dd, yy  (october 08, 06 or october 08, 2006)<br>dd monthname yy (08 october 06 or 08 october 2006)<br>day, dd monthname yy  (sun, 08 october 06)<br>CCyymmdd    (20061008   or  061008 )<br>CCyy-mm-dd  (2006-10-08 or 06-10-08 )<br>dd-monthname-CCyy (08-october-2006 or 08-october-06)<br><br>The default year is the current year. If the year is less than 100, we<br>treat the years 00-68 as 2000-2068 and the years 69-99 as 1969-1999. Not all platforms can represent the years 38-70, so an error may result if these years are used.<br><br>Time:<br>A time of day, which is of the form: <br>hh:mm:ss <br>meridian zone <br>hhmm meridian zone<br>If no meridian is specified, hh is interpreted on a 24-hour clock.<br>                                                                              <br>Also note that the date/time have to be within double-quotes " "<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Sun Oct 08, 2006 6:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[w00f]]></name></author>
		<updated>2006-10-08T11:27:06-04:00</updated>

		<published>2006-10-08T11:27:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67013#p67013</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67013#p67013"/>
		<title type="html"><![CDATA[[Help] Calculate time [Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67013#p67013"><![CDATA[
I've started to play with dates and stuff like that but in one the codes i've got a problem...i saw date.tcl but i was a little confused about how i can convert a date(10/01/06 09:20 for example[month/day/year Hours:minutes) to "clock second" format.<br><br>i've tried some codes but none of them seems to work as i want. <br>need help =X<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8264">w00f</a> — Sun Oct 08, 2006 11:27 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-10-06T02:51:03-04:00</updated>

		<published>2006-10-06T02:51:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66960#p66960</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66960#p66960"/>
		<title type="html"><![CDATA[[Help] Calculate time [Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66960#p66960"><![CDATA[
<blockquote class="uncited"><div>Hmm now that I look at my date.tcl script, you can simplify the difftime by just using [unixtime] to get the current time:<br><br>set difftime [duration [expr [unixtime] - $mytime]]</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Fri Oct 06, 2006 2:51 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[metroid]]></name></author>
		<updated>2006-10-06T01:45:25-04:00</updated>

		<published>2006-10-06T01:45:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66959#p66959</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66959#p66959"/>
		<title type="html"><![CDATA[[Help] Calculate time [Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66959#p66959"><![CDATA[
Sorry but why would you use clock scan on the current time if [clock seconds] or [unixtime] is available?<br><br>That just seems like you're making TCL do something that it doesn't have to.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5078">metroid</a> — Fri Oct 06, 2006 1:45 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[w00f]]></name></author>
		<updated>2006-10-05T13:42:09-04:00</updated>

		<published>2006-10-05T13:42:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66944#p66944</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66944#p66944"/>
		<title type="html"><![CDATA[[Help] Calculate time [Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66944#p66944"><![CDATA[
Thanks man , works great.<br><br>i'll take a look at date.tcl , could be usefull ;D<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8264">w00f</a> — Thu Oct 05, 2006 1:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-10-04T23:14:55-04:00</updated>

		<published>2006-10-04T23:14:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66937#p66937</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66937#p66937"/>
		<title type="html"><![CDATA[[Help] Calculate time [Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66937#p66937"><![CDATA[
Convert the time to EPOCH time, with clock scan:<br><br>set mytime [clock scan "10/04/06 23:54:41"]<br>set nowtime [clock scan [strftime "%m/%d/%y %T"]]<br><br>then use the 'duration' command to diff the times:<br><br>set difftime [duration [expr $nowtime - $mytime]]<br><br>Hmm now that I look at my date.tcl script, you can simplify the difftime by just using [unixtime] to get the current time:<br><br>set difftime [duration [expr [unixtime] - $mytime]]<br><br>The date.tcl script I (re)did has a whole lot of examples of manipulating dates/times and checking for leap years and valid input, reading/writing to files,  and so forth and so on. It's in the tcl archive if you want to look at it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Wed Oct 04, 2006 11:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[w00f]]></name></author>
		<updated>2006-10-21T17:08:35-04:00</updated>

		<published>2006-10-04T19:07:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66933#p66933</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66933#p66933"/>
		<title type="html"><![CDATA[[Help] Calculate time [Solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66933#p66933"><![CDATA[
hi there.<br><br>i need to know if there are any kind of way to calculate the time since i've added something that i'm searching for and the time when i trigger a certain command.<br><br>[23:54:41] (@w00f) !adefine w00f test!<br>[23:54:43] (@w00f) !define w00f<br>[23:54:44] (@b0T) w00f: test! :: added at 10/04/06 23:54:41<br><br>what i want is to convert that time (10/04/06 23:54:41 , i save the time when i add the definition) to something like this:<br><br>[23:54:44] (@b0T) w00f: test! :: added 3s ago.<br><br>a month later<br><br>[23:54:44] (@b0T) w00f: test! :: added 1m 3s ago.<br>or <br>[23:54:44] (@b0T) w00f: test! :: added 4w 3s ago.<br>or 4w 0d 0h 0m 3s ago<br><br>something like that would be great.<br><br><br>tnks in advance.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8264">w00f</a> — Wed Oct 04, 2006 7:07 pm</p><hr />
]]></content>
	</entry>
	</feed>
