<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Date Math in .NET</title>
	<atom:link href="http://bobondevelopment.com/2007/05/21/date-math-in-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://bobondevelopment.com/2007/05/21/date-math-in-net/</link>
	<description>Musings on the craft and business of software development</description>
	<lastBuildDate>Thu, 26 Aug 2010 03:21:57 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Matt Unks</title>
		<link>http://bobondevelopment.com/2007/05/21/date-math-in-net/comment-page-1/#comment-1862</link>
		<dc:creator>Matt Unks</dc:creator>
		<pubDate>Wed, 23 May 2007 13:58:23 +0000</pubDate>
		<guid isPermaLink="false">http://bobondevelopment.com/2007/05/21/date-math-in-net/#comment-1862</guid>
		<description>I agree. In fact someday our code will probably look rather outdated to some other more modern language. Who knows maybe in C# 5.0 you will just type DateTime.February or something similar  :)</description>
		<content:encoded><![CDATA[<p>I agree. In fact someday our code will probably look rather outdated to some other more modern language. Who knows maybe in C# 5.0 you will just type DateTime.February or something similar  :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Unks</title>
		<link>http://bobondevelopment.com/2007/05/21/date-math-in-net/comment-page-1/#comment-1858</link>
		<dc:creator>Matt Unks</dc:creator>
		<pubDate>Tue, 22 May 2007 18:13:07 +0000</pubDate>
		<guid isPermaLink="false">http://bobondevelopment.com/2007/05/21/date-math-in-net/#comment-1858</guid>
		<description>How about this:
I like the Days in month feature as well.

Where Year = some integer and 
Month is another integer

DateTime.DaysInMonth(Year, Month)

&lt;em&gt;Bob responds: Thanks, Matt!  All these great suggestions underscore that you should not ignore the wealth of resources in the CLR by focusing only on legacy language features!  Seriously, I don&#039;t think the author of the original code I showed was stupid or careless; but they were stuck in a rut (in this case, a legacy VB6 / VBScript rut).  Paradoxically, it may have seemed easier to the coder to do it the hard way, because it would have cost as much or more to stop and look up what was available.  But look at the benefits that would have flowed from that little interlude of discovery.&lt;/em&gt;</description>
		<content:encoded><![CDATA[<p>How about this:<br />
I like the Days in month feature as well.</p>
<p>Where Year = some integer and<br />
Month is another integer</p>
<p>DateTime.DaysInMonth(Year, Month)</p>
<p><em>Bob responds: Thanks, Matt!  All these great suggestions underscore that you should not ignore the wealth of resources in the CLR by focusing only on legacy language features!  Seriously, I don&#8217;t think the author of the original code I showed was stupid or careless; but they were stuck in a rut (in this case, a legacy VB6 / VBScript rut).  Paradoxically, it may have seemed easier to the coder to do it the hard way, because it would have cost as much or more to stop and look up what was available.  But look at the benefits that would have flowed from that little interlude of discovery.</em></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://bobondevelopment.com/2007/05/21/date-math-in-net/comment-page-1/#comment-1854</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Mon, 21 May 2007 20:26:57 +0000</pubDate>
		<guid isPermaLink="false">http://bobondevelopment.com/2007/05/21/date-math-in-net/#comment-1854</guid>
		<description>bah, knee-jerk post, didn&#039;t see the assumed &quot;Today&quot; variable, but adds even shorter goodness:

dtpStart.Value = new DateTime(Today.Year, Today.Month, 1)

&lt;em&gt;Bob responds: You sound like a fellow C# guy.  Today is baked into the Microsoft.VisualBasic namespace.  When I first saw &quot;Now&quot; in the original code, I automatically used &quot;Today&quot; assuming that it was VB-speak for &quot;DateTime.Today&quot;.  Actually as I&#039;ve mentioned &lt;a href=&quot;/2007/02/07/do-you-use-language-specific-features-that-replicate-provided-net-functionality/&quot; rel=&quot;nofollow&quot;&gt;elsewhere&lt;/a&gt;, I&#039;d personally stick with DateTime.Today even in VB.NET, though.&lt;/em&gt;</description>
		<content:encoded><![CDATA[<p>bah, knee-jerk post, didn&#8217;t see the assumed &#8220;Today&#8221; variable, but adds even shorter goodness:</p>
<p>dtpStart.Value = new DateTime(Today.Year, Today.Month, 1)</p>
<p><em>Bob responds: You sound like a fellow C# guy.  Today is baked into the Microsoft.VisualBasic namespace.  When I first saw &#8220;Now&#8221; in the original code, I automatically used &#8220;Today&#8221; assuming that it was VB-speak for &#8220;DateTime.Today&#8221;.  Actually as I&#8217;ve mentioned <a href="/2007/02/07/do-you-use-language-specific-features-that-replicate-provided-net-functionality/" rel="nofollow">elsewhere</a>, I&#8217;d personally stick with DateTime.Today even in VB.NET, though.</em></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://bobondevelopment.com/2007/05/21/date-math-in-net/comment-page-1/#comment-1853</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Mon, 21 May 2007 20:25:54 +0000</pubDate>
		<guid isPermaLink="false">http://bobondevelopment.com/2007/05/21/date-math-in-net/#comment-1853</guid>
		<description>While I agree with dtpEnd, dtpStart is a little obfuscated.  Wouldn&#039;t you see the same benefit with added clarity with something like...

dtpStart.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1)

&lt;em&gt;Bob responds: Yep, your way is more self-evident.  Self-evident is good!&lt;/em&gt;</description>
		<content:encoded><![CDATA[<p>While I agree with dtpEnd, dtpStart is a little obfuscated.  Wouldn&#8217;t you see the same benefit with added clarity with something like&#8230;</p>
<p>dtpStart.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1)</p>
<p><em>Bob responds: Yep, your way is more self-evident.  Self-evident is good!</em></p>
]]></content:encoded>
	</item>
</channel>
</rss>
