<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0">
			<channel>
			<title>CFNewbie?com - CFIF</title>
			<link>http://www.cfnewbie.com/cfnewbie/client/index.cfm</link>
			<description>CFNewbie?com</description>
			<language>en-us</language>
			<pubDate>Wed, 08 Sep 2010 13:14:56-0700</pubDate>
			<lastBuildDate>Wed, 08 Aug 2007 22:19:00-0700</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>tom.barr@gmail.com</managingEditor>
			<webMaster>tom.barr@gmail.com</webMaster>
			
			
			
			
			
			<item>
				<title>CFTIME: How to Make Content Appear and Disappear</title>
				<link>http://www.cfnewbie.com/cfnewbie/client/index.cfm/2007/8/8/CFTIME-How-to-Make-Content-Appear-and-Disappear</link>
				<description>
				
				&lt;p&gt;&lt;font face=&quot;Arial, Helvetica, sans-serif&quot;&gt; Content on the web often has 
        a shelf life. You may have information that you want up after a certain 
        point in time or you may want it to be gone after a certain time.You may 
        want to have it appear and disappear without having to be editing files 
        or changing out input in some back end system. You will find that you 
        can build a simple system for publishing and removing info with &lt;a href=&quot;http://www.adobe.com/software/coldfusion/&quot; target=&quot;_blank&quot;&gt;ColdFusion&lt;/a&gt;&apos;s 
        &lt;strong&gt;CFIF&lt;/strong&gt; tag and &lt;strong&gt;CreateDateTime()&lt;/strong&gt; and &lt;strong&gt;Now()&lt;/strong&gt; 
        functions.&lt;/font&gt;&lt;/p&gt;

 &lt;p&gt;&lt;font face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;strong&gt;CFIF&lt;/strong&gt; is one 
        of the most basic and commonly used tags in ColdFusion. We will use it 
        to hide or display content based on comparing a set date to the time that 
        the page is parsed for the visitor. &lt;/font&gt;&lt;/p&gt;
      &lt;p&gt;&lt;font face=&quot;Arial, Helvetica, sans-serif&quot;&gt;The &lt;strong&gt;CreateDateTime()&lt;/strong&gt; 
        function takes date and time parameters and creates a ColdFusion date/time 
        object. The format is CreateDateTime(year,month, day, hour, minute, second). 
        An example would be CreateDateTime (2004, 7, 9,19,59, 0) for July 9, 2004 
        at 7:59pm. &lt;/font&gt;&lt;/p&gt;

      &lt;p&gt;&lt;font face=&quot;Arial, Helvetica, sans-serif&quot;&gt;The &lt;strong&gt;Now()&lt;/strong&gt; 
        function takes no parameters and produces a ColdFusion date/time object 
        for the current date and time including seconds. &lt;/font&gt;&lt;/p&gt;
      &lt;p&gt;&lt;font face=&quot;Arial, Helvetica, sans-serif&quot;&gt;Example Code&lt;/font&gt;&lt;/p&gt;
      &lt;p&gt;&lt;font face=&quot;Arial, Helvetica, sans-serif&quot;&gt;The components are simple so 
        let&apos;s put it all together. Our first example is content that displays 
        until a future point in time. In this case if the date/time is less than 
        the target date your content will display. This would be usefull if yo 
        had a contest running and wanted to remove the content from your site 
        when the contest was over.&lt;/font&gt;&lt;/p&gt;
      &lt;p&gt; &lt;font face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&amp;lt;cfif #now()# lte #CreateDateTime 
        (2004, 7, 9,19,59, 0)#&amp;gt;&lt;br&gt;
        This content is displayed until July 7, 2004 at 7:59pm.&lt;br&gt;

        &amp;lt;/cfif&amp;gt; &lt;/font&gt;&lt;/p&gt;
      &lt;p&gt;&lt;font face=&quot;Arial, Helvetica, sans-serif&quot;&gt; Our next example is content 
        that displays after a future point in time. In this case if the date/time 
        is greater than the target date your content will display. This would 
        be handy if you had an announcement coming up so you could announce it 
        on your web site without having to sit at your computer and trigger the 
        new content.&lt;/font&gt;&lt;/p&gt;
      &lt;p&gt;&lt;font face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&amp;lt;cfif #now()# gte #CreateDateTime 
        (2004,7,5,10,30, 0)# &amp;gt;&lt;br&gt;
        This content is displayed after July 5, 2004 at 10:30am.&lt;br&gt;
        &amp;lt;/cfif&amp;gt; &lt;/font&gt;&lt;/p&gt;

      &lt;p&gt;&lt;font face=&quot;Arial, Helvetica, sans-serif&quot;&gt;Our last example is content 
        that displays after a future point in time and ends at a later date. In 
        this case if the date/time is greater than the target date and it was 
        smaller than a second target date, your content will display. This would 
        be handy if you had an announcement coming up so you could announce it 
        on your web site without having to sit at your computer and trigger the 
        new content and it would also remove the announcement at the appropriate 
        time.&lt;/font&gt;&lt;/p&gt;
      &lt;p&gt;&lt;font face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&amp;lt;cfif #now()# lte #CreateDateTime 
        (2004, 7, 9,19,59, 0)# &lt;br&gt;
        AND #now()# gte #CreateDateTime (2004,5, 2,10,30, 0)# &amp;gt;&lt;br&gt;
        This content is displayed after May 5, 2004 at 10:30am and disappears 
        after July 7, 2004 at 7:59pm .&lt;br&gt;
        &amp;lt;/cfif&amp;gt; &lt;/font&gt;&lt;/p&gt;
      &lt;p&gt;&lt;font face=&quot;Arial, Helvetica, sans-serif&quot;&gt;Summary&lt;/font&gt;&lt;/p&gt;

      &lt;p&gt;&lt;font face=&quot;Arial, Helvetica, sans-serif&quot;&gt;ColdFusion makes dealing with 
        times and dates easy with built in functions like CreateDateTime() and 
        Now(). Developers won&apos;t need to be on call for special announcements or 
        the end of a campaign. Test out some examples of your own making and then 
        don&apos;t let the clock and your computer dictate when you are making content 
        appear and disappear.&lt;/font&gt;&lt;/p&gt;
				
				</description>
						
				
				<category>CFIF</category>				
				
				<category>Basics</category>				
				
				<category>CFOUTPUT</category>				
				
				<pubDate>Wed, 08 Aug 2007 22:19:00-0700</pubDate>
				<guid>http://www.cfnewbie.com/cfnewbie/client/index.cfm/2007/8/8/CFTIME-How-to-Make-Content-Appear-and-Disappear</guid>
				
			</item>
			
		 	
			</channel></rss>