[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 628
  • Last Modified:

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

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
bmanmike39
Asked:
bmanmike39
1 Solution
 
käµfm³d 👽Commented:
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
 
bmanmike39Author Commented:
Thanks!
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

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