<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : DateDiff Function in the Calendar Sample</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Calendar : DateDiff Function in the Calendar Sample]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 21 May 2026 01:45:25 +0000</pubDate>
  <lastBuildDate>Sun, 24 May 2009 15:45:31 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=14373</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[DateDiff Function in the Calendar Sample : The use of the DateDiff function...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14373&amp;PID=49302&amp;title=datediff-function-in-the-calendar-sample#49302</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1401">jpcoffeyXXX</a><br /><strong>Subject:</strong> 14373<br /><strong>Posted:</strong> 24 May 2009 at 3:45pm<br /><br />The use of the DateDiff function in the Calendar Sample application is baffling to me.&nbsp; In the frmEditEvent in the Calendar sample, the following code is listed for the SetStartEnd function,<br><br><pre>    <font color="#0000a0">If</font> AllDay <font color="#0000a0">Then</font><br>        cmbEndTime.Visible = <font color="#0000a0">False</font><br>        cmbStartTime.Visible = <font color="#0000a0">False</font><br><br>        <font color="#0000a0">If DateDiff</font><font color="#c00000">(</font><font color="#008080">"s"</font>, EndTime, 0<font color="#c00000">)</font> = 0 <font color="#0000a0">Then</font><br>            EndDate = EndDate - 1<br>        <font color="#0000a0">End If</font><br>    <font color="#0000a0">End If</font><br></pre>        Also in the UpdateEventFromControls routine this code is listed,<br><br><pre>    <font color="#0000a0">If</font> chkAllDayEvent.Value = 1 <font color="#0000a0">Then</font><br>        <font color="#0000a0">If DateDiff</font><font color="#c00000">(</font><font color="#008080">"s"</font>, <font color="#0000a0">TimeValue</font><font color="#c00000">(</font>EndTime<font color="#c00000">)</font>, 0<font color="#c00000">)</font> = 0 <font color="#0000a0">Then</font><br>            EndTime = EndTime + 1<br>        <font color="#0000a0">End If</font><br>    <font color="#0000a0">End If</font><br></pre>        <br>Can someone clarify what this check is for?&nbsp; I don't see why we have to add a day to the EndTime.&nbsp; I don't understand why the DateDiff is being calculated against a value of 0.&nbsp; I can understand that it is a comparison to see if there is a 0 value for EndTime, but why do they add the number 1 to the EndTime if the EndTime is indeed 0?&nbsp; Why wouldn't they add a 1 to the StartTime instead?&nbsp; Thanks for your feedback.<br><br>Sincerely,<br><br>John Coffey<br><br><br>]]>
   </description>
   <pubDate>Sun, 24 May 2009 15:45:31 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14373&amp;PID=49302&amp;title=datediff-function-in-the-calendar-sample#49302</guid>
  </item> 
 </channel>
</rss>