GetFormattedMonthAndDay

edit

GetFormattedMonthAndDay

Namespace

Summary== Given a datetime object, returns the formatted month and day, i.e. "April 15th" ==Example==var output=Post.PublishDate.GetFormattedMonthAndDay(); ==Unit Test

public void GetFormattedMonthAndDayShouldBeApril16thForParsedDate() { var today = DateTime.Parse("4/16/2009"); var result = today.GetFormattedMonthAndDay(); Assert.Equal("April 16th", result); }

Comments

SubSonic 3.0 implements this as an extension on System.DateTime - 2.x uses a static method on SubSonic.Sugar.Dates.