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

	<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>2010-01-27T20:47:04-04:00</updated>

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

		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2010-01-27T20:47:04-04:00</updated>

		<published>2010-01-27T20:47:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91875#p91875</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91875#p91875"/>
		<title type="html"><![CDATA[Validating a date]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91875#p91875"><![CDATA[
Sorry, yes you are correct speechless :-<br><br>[00:34] &lt;arfer&gt; .tcl set test $tcl_platform(os)<br>[00:34] &lt;Baal&gt; Tcl: Linux<br>[00:35] &lt;arfer&gt; .tcl set test $tcl_version<br>[00:35] &lt;Baal&gt; Tcl: 8.4<br>[00:35] &lt;arfer&gt; .tcl set test [clock scan 13/33/10]<br>[00:35] &lt;Baal&gt; Tcl error: unable to convert date-time string "13/33/10"<br><br>[00:32] &lt;arfer&gt; .tcl set test $tcl_platform(os)<br>[00:32] &lt;osmosis&gt; Tcl: CYGWIN_NT-6.0<br>[00:32] &lt;arfer&gt; .tcl set test $tcl_version<br>[00:32] &lt;osmosis&gt; Tcl: 8.5<br>[00:33] &lt;arfer&gt; .tcl set test [clock scan 13/33/10]<br>[00:33] &lt;osmosis&gt; Tcl: 1296604800<br><br>In view of the pending 32 bit issue, I'm not entirely sure if it is a bright side <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> or a not so bright side <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"> but I probably won't get to see 2038.<br><br>Thanks for the site Sir_Fz, I'll devise something along those lines most probably (that is one mean looking regexp).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Wed Jan 27, 2010 8:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2010-01-27T18:43:22-04:00</updated>

		<published>2010-01-27T18:43:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91873#p91873</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91873#p91873"/>
		<title type="html"><![CDATA[Re: Validating a date]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91873#p91873"><![CDATA[
Arfer, are you sure you don't have that backwards? Tcl 8.5 should accept the bogus date and return a bogus value, while tcl8.4 should return the "unable to convert date/time string" reply.<br><br>Clock was changed in tcl8.5, <a href="http://www.tcl.tk/cgi-bin/tct/tip/173" class="postlink">see here</a>.<br><blockquote class="uncited"><div>&lt;speechles&gt; .tcl set a [catch {set b [clock scan 1/1/10]}]<br>&lt;sp33chy&gt; Tcl: 0<br>&lt;speechles&gt; .tcl set a [catch {set b [clock scan 33/1/10]}]<br>&lt;sp33chy&gt; Tcl: 1<br>&lt;speechles&gt; .tcl set from [clock scan 13/33/10] <br>&lt;sp33chy&gt; Tcl error: unable to convert date-time string "13/33/10"<br>&lt;speechles&gt; .tcl set test [clock scan 1/1/37]<br>&lt;sp33chy&gt; Tcl: 2114409600<br>&lt;speechles&gt; .tcl set test [clock scan 1/1/38]<br>&lt;sp33chy&gt; Tcl error: unable to convert date-time string "1/1/38"</div></blockquote><div class="codebox"><p>Code: </p><pre><code>&lt;sp33chy&gt; I am sp33chy, running eggdrop v1.6.17: 25 users (mem: 1481k).&lt;sp33chy&gt; Online for 9 days, 01:26 (background) - CPU: 34:44 - Cache hit: 9.6%&lt;sp33chy&gt; Admin: jesus&lt;sp33chy&gt; Config file: eggdrop.conf&lt;sp33chy&gt; OS: CYGWIN_NT-5.1 1.5.18(0.132/4/2)&lt;sp33chy&gt; Tcl library: /cygdrive/f/windrop/lib/tcl8.4&lt;sp33chy&gt; Tcl version: 8.4.11 (header version 8.4.11)</code></pre></div>A problem in the future will be that 32bit systems wont like the year 2038 very much.. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Wed Jan 27, 2010 6:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2010-01-27T16:43:20-04:00</updated>

		<published>2010-01-27T16:43:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91871#p91871</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91871#p91871"/>
		<title type="html"><![CDATA[Validating a date]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91871#p91871"><![CDATA[
Not sure if Tcl is affected by the regional settings of the running machine, but if so it could be that the date format on the latter machine is not %m/%d/%y.<br><br>After a quick Google search, I found <a href="http://tclhelp.net/unb/71" class="postlink">this</a>. You can try and and see if it's correct and then modify it to suite your needs.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Wed Jan 27, 2010 4:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2010-01-27T16:28:00-04:00</updated>

		<published>2010-01-27T16:28:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91870#p91870</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91870#p91870"/>
		<title type="html"><![CDATA[Validating a date]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91870#p91870"><![CDATA[
I'm using the following to try to validate a date in the normal US form m?m/d?d/yy (by validate I mean assertain if such a date could exist) :-<br><div class="codebox"><p>Code: </p><pre><code>if {[catch {set from [clock scan $date]} {  # error code} else {  # remainder of code}</code></pre></div>I fully expected that an invalid date such as 13/33/10 would be caught by the above code.<br><br>My Eggdrop running Tcl 8.5 functions as I expected. Using similar code in the partyline yields :-<br><br>[20:12] &lt;arfer&gt; .tcl set from [clock scan 13/33/10]<br>[20:12] &lt;Baal&gt; Tcl error: unable to convert date-time string "13/33/10"<br><br>My Windrop running Tcl 8.4 does not function as expected, yielding the following in the partyline :-<br><br>[20:11] &lt;arfer&gt; .tcl set from [clock scan 13/33/10]<br>[20:11] &lt;osmosis&gt; Tcl: 1296604800<br><br>I'm not sure if this a Tcl version issue or a Windows/Linux date/time issue or even a geographical issue or a combination thereof.<br><br>In any event, what (hopefully simplistic) code is recommended for validating dates that functions as expected irrespective of the bot type, Tcl version, operating system or geography.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Wed Jan 27, 2010 4:28 pm</p><hr />
]]></content>
	</entry>
	</feed>
