Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7980337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:02:34+00:00 2026-06-04T10:02:34+00:00

So I want a date formated like this 27/7. My code looks like this

  • 0

So I want a date formated like this 27/7. My code looks like this

<%# Eval("WStartDate", "{0:d/M}" ) %>

And the result is a date that looks like: 27-7.

How can I change this? I dont want to change my regional settings….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T10:02:37+00:00Added an answer on June 4, 2026 at 10:02 am
    <%# Eval("WStartDate", "{0:d'/'M}" ) %>
    

    The reason why you get - instead of / is because the / character has a special meaning in a DateTime format: it represents the date separator in the current culture. If you want to display as literal you should escape it with single quotes: '.


    UPDATE:

    According to your comment it seems that you are using this Eval statement inside an ASP.NET server side tag to set some property such as a label text for example. In this case you could define the format as a separate variable:

    <script type="text/c#" runat="server">
        string format = "{0:d'/'M}";
    </script>
    

    and then use it:

    <asp:Label 
        runat="server" 
        Text='<%# Eval("WStartDate", format) %>'
    />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to display date like this in my website Wednesday, March 03, 2010
I want to make the date to change one day every n seconds, like
I want the date&time to be in this format. For example 2012/3/21 23:47:01 2011/11/23
I want the date to be sn at my page, I used this fn
I want to display something like 2010-10-20 by Mary in the h:outputText. The date
Without use of marquee tag I want to show news like below code.I want
In my application I am using code like this: DateFormat df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT,
I currently have a date which is formatted in PHP like this date('D d
I'm getting dates formatted like this: 2011-04-14 15:00:00, and want to set them to
I want to do something like this: <c:set var=strDate value=<fmt:formatDate value='${obj.dateIn}' pattern='ddMMyyyy'/>/> to obtain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.