<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Gen-Y Librarian &#187; ASP</title>
	<atom:link href="http://ygenlibrarian.wordpress.com/tag/asp/feed/" rel="self" type="application/rss+xml" />
	<link>http://ygenlibrarian.wordpress.com</link>
	<description>My thoughts.</description>
	<lastBuildDate>Mon, 21 Jul 2008 21:00:58 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='ygenlibrarian.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/0bbf73f6547bce2986d0407de579126a?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Gen-Y Librarian &#187; ASP</title>
		<link>http://ygenlibrarian.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://ygenlibrarian.wordpress.com/osd.xml" title="Gen-Y Librarian" />
		<item>
		<title>ASP code for library hours</title>
		<link>http://ygenlibrarian.wordpress.com/2007/12/20/asp-code-for-library-hours/</link>
		<comments>http://ygenlibrarian.wordpress.com/2007/12/20/asp-code-for-library-hours/#comments</comments>
		<pubDate>Thu, 20 Dec 2007 04:38:24 +0000</pubDate>
		<dc:creator>Logan</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://libguy.info/?p=17</guid>
		<description><![CDATA[Today I spent most of my day writing an ASP code from scratch that will display our hours based on the date.  While this sounds simple, here are the steps I followed:

Set a variable today as Date()
Declare the base rule  for the three days we have the same hours.
Set exceptions by day of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ygenlibrarian.wordpress.com&blog=3937609&post=17&subd=ygenlibrarian&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Today I spent most of my day writing an ASP code from scratch that will display our hours based on the date.  While this sounds simple, here are the steps I followed:</p>
<ul>
<li>Set a variable <em>today </em>as Date()</li>
<li>Declare the base rule  for the three days we have the same hours.</li>
<li>Set exceptions by day of the week above that</li>
<li>Set our closed for the holiday dates above the standard hours</li>
<li>Set our finals hours above those</li>
</ul>
<p>Since ASP executes in a logical &#8220;If..Elseif&#8230;Else..End if&#8221; statement, this works.  However, I then realized one fact: we&#8217;re open past midnight at times.  I don&#8217;t want the next days hours to start until 1:00am.  A quick chat with our campus ASP person to figure out what to do and some creative errors (don&#8217;t we learn best by errors?) I was able to declare the following statement:</p>
<p><span style="text-decoration:line-through;">If Time() &lt; &#8220;01:01 AM&#8221; then<br />
today = DateAdd(&#8220;d&#8221;,-1,today)</span></p>
<p><strong>Update:</strong></p>
<p>Dim miltime<br />
miltime = FormatDateTime(today,4)<br />
If miltime &lt; &#8220;01:01:00&#8243; Then<br />
today = DateAdd(&#8220;d&#8221;,-1,today)</p>
<p>This says that if it&#8217;s before 1:01am, then subtract one day from the date, effectively turning back time.</p>
<p>Easy enough, eh?  Well, I decided I didn&#8217;t like the standard time display &#8220;Wednesday, December 19, 2007.&#8221;  So, I used some more ASP to break it apart and display the Month, Day and a new variable called <em>ord</em> which stands for the ordinal number contraction (st, nd, rd, th).  I threw that in an If..Then statement right after the time statement but before the hours designation.   All in all, it worked out.</p>
<p>Bottom line: Email me if you want the code: libguy@libguy.info.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ygenlibrarian.wordpress.com/17/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ygenlibrarian.wordpress.com/17/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ygenlibrarian.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ygenlibrarian.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ygenlibrarian.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ygenlibrarian.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ygenlibrarian.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ygenlibrarian.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ygenlibrarian.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ygenlibrarian.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ygenlibrarian.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ygenlibrarian.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ygenlibrarian.wordpress.com&blog=3937609&post=17&subd=ygenlibrarian&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ygenlibrarian.wordpress.com/2007/12/20/asp-code-for-library-hours/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cdc5bb208e6d7b531f8bc048ed9e6fc6?s=96&#38;d=identicon" medium="image">
			<media:title type="html">ltr2</media:title>
		</media:content>
	</item>
	</channel>
</rss>