Solved

How would I change the date format {0:d} to display just the month?  I'm coding in Asp.net C#

Posted on 2014-02-23
2
581 Views
Last Modified: 2014-02-23
How would I change this date format to show just the month?  BTW, this label is part of a listview control:
<asp:Label ID="dateLabel" runat="server" Text='<%# Eval("date", "{0:d}") %>' 
                            Font-Bold="True" />

Open in new window






Thanks
0
Comment
Question by:bmanmike39
2 Comments
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
Comment Utility
Use "M" instead.

e.g.

<asp:Label ID="dateLabel" runat="server" Text='<%# Eval("date", "{0:M}") %>' 
                            Font-Bold="True" />

Open in new window


You can check the following site for more format specifiers:  http://blog.stevex.net/string-formatting-in-csharp/
0
 

Author Closing Comment

by:bmanmike39
Comment Utility
Thanks!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

772 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

8 Experts available now in Live!

Get 1:1 Help Now