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
593 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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

679 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