Search Options
close
Search the following clips:
All Clips
Everyone's Clips
My Guides
Sign Up
Install
Learn More
Login
A Set of Useful Extension Methods for DateTime
travislaborde
follow
0
3-19-2008 7:46 AM
188 views
tags:
programming
,
.net
,
2008
travislaborde
says:
Extension Methods - Yummy
Add a Comment
Login
to Comment. Not a member yet?
Sign up
Related Clips
Radio Paradise - listener-supported eclect...
Microsoft.Net Application Development, Dot...
Programming Cheat Sheet Round-up.
How Barack Knocked the Satire Out of Me
Free education on the Internet - Courses,...
No one can afford to ignore the artist wit...
These kittens have gotten a free pass from...
More clips from
travislaborde
How to Supress the Urge to Kill
Ulterior Motive Lounge Episode 2: Who Ya G...
Updated ZoomIt from Microsoft (Sysinternals)
Today's Top Clips
Marijuana improves memory
THE IMPRINTED BRAIN THEORY
The Boy With The Incredible Brain
What Happy People Don't Do
This Dog is Awesome!
Most Beautiful Homeless Hostel in the World
Vatican: Homosexuality is a "grave sin"
Forgotten But Not Gone: How The Brain Re-learns
Physicists Find Dark Matter, or Something Even More Strange
We are becoming people of the screen.
visit the
Top Clips page
View the Top Clips from
March 19, 2008
Embed This Clip In Your Site...
<div style="margin: 12px 0px; font-family: arial; color: #333333; background: #ffffff; border: solid 4px #e5e5e5; width: 100%; clear: left;"><div class="CM_CTB_Content_Wrap" style="margin: 0px; padding: 0px;background-color: #ffffff;"><div style="border-bottom: solid 1px #dcdcdc; white-space: nowrap; margin-bottom: 8px; background-color: #eeeeee ;background-image: url(http://clipmarks.com/images/source-bg.gif); background-repeat: repeat-x; height: 24px; line-height: 24px; vertical-align: middle; padding-bottom: 4px; color: #666666; font-size: 10px;" ><a href="http://clipmarks.com/clip-to-blog/" title="see clips that are hot right now"><img src="http://content.clipmarks.com/blog_embed/59aae05c-fb3d-4197-b3d8-d9c147d47db5/591B1D43-4541-451D-8E01-9A9F209EA737/" alt="" width="19" height="19" border="0" style="vertical-align: middle; margin: 0px 4px; display: inline; border: none; float:none;" /></a>clipped from <a title="http://www.iridescence.no/Posts/A-Set-of-Useful-Extension-Methods-for-DateTime.aspx" href="http://www.iridescence.no/Posts/A-Set-of-Useful-Extension-Methods-for-DateTime.aspx" style="font-size: 11px;">www.iridescence.no</a></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://www.iridescence.no/Posts/A-Set-of-Useful-Extension-Methods-for-DateTime.aspx"><H1>A Set of Useful Extension Methods for DateTime</H1></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://www.iridescence.no/Posts/A-Set-of-Useful-Extension-Methods-for-DateTime.aspx"><P><STRONG>First()<BR /></STRONG>This method returns a DateTime representing the first day of the month represented by the instance it is called on. For example:</P></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://www.iridescence.no/Posts/A-Set-of-Useful-Extension-Methods-for-DateTime.aspx"><PRE><SPAN>DateTime</SPAN> firstOfMarch = <SPAN>DateTime</SPAN>.Now.First();</PRE></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://www.iridescence.no/Posts/A-Set-of-Useful-Extension-Methods-for-DateTime.aspx"><P><STRONG>First(DayOfWeek dayOfWeek)<BR /></STRONG>This method returns the first occurrence of the specified day in the month represented by the instance it is called on. For example, the first Monday of this month was the 3rd of March:</P></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://www.iridescence.no/Posts/A-Set-of-Useful-Extension-Methods-for-DateTime.aspx"><PRE><SPAN>DateTime</SPAN> thirdOfMarch = <SPAN>DateTime</SPAN>.Now.First(<SPAN>DayOfWeek</SPAN>.Monday);</PRE></blockquote></div><div style="margin: 0px 6px 6px 4px;"><table style="font-size: 11px;border-spacing: 0px;padding: 0px;" cellpadding="0" cellspacing="0" width="100%"><tr><td style="background:transparent;border-width:0px;padding:0px;"> </td><td align="right" style="background:transparent;border-width:0px;padding:0px;width:107px" width="107"><a href="http://clipmarks.com/share/591B1D43-4541-451D-8E01-9A9F209EA737/blog/" title="blog or email this clip"><img src="http://content6.clipmarks.com/images/c2b-foot.png" border="0" alt="blog it" width="107" height="17" style="border-width:0px;padding:0px;margin:0px;" /></a></td></tr></table></div></div>
Clipmarks
Home
New Clips
Top Clips
Dashboard
Popular Topics
News
Life
Science
Technology
Entertainment
Get Started
Sign Up
Install Clipping Tool
How Clipping Works
Clip-to-Blog™
ClipSearch
Tools and Resources
FAQ
ClipWeek
Top Clippers
Top Tags
Site Map
About Clipmarks
About Us
Contact
Blog
Copyright
Privacy
EULA
OK