Solved

use DateTime.Now to display month and year

Posted on 2015-02-10
1
70 Views
Last Modified: 2015-02-10
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
Comment
Question by:knowlton
1 Comment
 
LVL 5

Accepted Solution

by:
knowlton earned 0 total points
ID: 40601804
Seems like:

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

gave me what I wanted.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now