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
590 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 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39880759
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
ID: 39880802
Thanks!
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

828 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