• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 107
  • Last Modified:

use DateTime.Now to display month and year

lblSubTitle.Text = new DateTime().Month.ToString("m") + new DateTime().Year.ToString("yyyy");

Says format specifier is invalid.

Can someone tell me what I should use?  I want to display this:

"February 2015"
0
Tom Knowlton
Asked:
Tom Knowlton
1 Solution
 
Tom KnowltonWeb developerAuthor Commented:
Seems like:

 lblSubTitle.Text = tempdt.ToString("MMMM yyyy");

gave me what I wanted.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now