<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: vb code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Tue, 07 Oct 2008 18:37:03 GMT</pubDate>
    <description>DZone Snippets: vb code</description>
    <item>
      <title>Calculate last day of current Month</title>
      <link>http://snippets.dzone.com/posts/show/5183</link>
      <description>'Determines what the next month is based on today and subtracts 1 day from first day of next month. &lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;'VB.NET&lt;br /&gt;Dim NextMonth As Integer&lt;br /&gt;Dim RptYear As Integer&lt;br /&gt;'Determine next month&lt;br /&gt;NextMonth = DatePart(DateInterval.Month, DateAdd(DateInterval.Month, +1, today))&lt;br /&gt;'Determine the year of the next month, in case you are going from Dec to Jan&lt;br /&gt;RptYear = DatePart(DateInterval.Year, DateAdd(DateInterval.Month, +1, today))&lt;br /&gt;'Subtract 1 day from the first day of next month to get this months last day&lt;br /&gt;Return DateAdd(DateInterval.Day, -1, DateValue(NextMonth.ToString &amp; "/1/" &amp; RptYear.ToString))&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;</description>
      <pubDate>Wed, 27 Feb 2008 19:13:47 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5183</guid>
      <author>bmowbray (Brian Mowbray)</author>
    </item>
  </channel>
</rss>
