Tim Hibbard

CEO for EnGraph software
posts - 628 , comments - 1634 , trackbacks - 459

My Links

News



Add to Google

Twitter












Tag Cloud

Article Categories

Archives

Post Categories

Image Galleries

EnGraph Blogs

Links

Other

Roll

June 2008 Entries

C# DateTime extension method
Currently DateTime.ToShortDateString will not include any "0" prefixes. I think this makes any vertical lists of dates look funky: Here is a very simple extension method that will append any needed leading "0" to the date: namespace ParaPlan.Extensions{ public static class DateHelper { public static string ToShortDateEqualLengthStrin... DateTime dt) { var rv = new StringBuilder(); if (dt.Month.ToString().Length ==1) { rv.Append("0"); } rv.Append(dt.Month.ToString... rv.Append("/"); if (dt.Day.ToString().Length ......

Posted On Thursday, June 26, 2008 3:43 PM | Comments (8) | Filed Under [ EnGraph .NET Goldstar ]

Powered by: