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

  • Home
  • SEARCH
  • 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 273997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T00:32:31+00:00 2026-05-12T00:32:31+00:00

I have a fairly standard .Net MVC Controller method: public ActionResult Add(Customer cust) {

  • 0

I have a fairly standard .Net MVC Controller method:

public ActionResult Add(Customer cust) {  
  //do something...  
  return View();
}

Where Customer is something like:

public class Customer {
  public DateTime DateOfBirth { get; set; }
  //more stuff...
}

And a page containing:

<div><%= Html.TextBox("DateOfBirth") %></div>

The problem is my site is located on a US server so the cust.DateOfBirth is parsed in the US format MM/dd/yyyy. However, I want the users to enter their date of birth in the UK format dd/MM/yyyy.

Can I change the default input format on the DateTime ModelBinder or do I have to create my own custom ModelBinder?

  • 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-05-12T00:32:31+00:00Added an answer on May 12, 2026 at 12:32 am

    You can change the culture in the web.config file or at the page level. If you only want to change the date format and not the other aspects of the culture, though, that may require that you modify the current culture’s DateTimeFormat via code in global.asax or a common base controller and set it to the DateTimeFormat for “en-GB”.

    Reference

    To set the UI culture and culture for
    all pages, add a globalization section
    to the Web.config file, and then set
    the uiculture and culture attributes,
    as shown in the following example:

    <globalization uiCulture="en"
    culture="en-GB" />

    To set the UI culture and culture for
    an individual page, set the Culture
    and UICulture attributes of the @ Page
    directive, as shown in the following
    example:

    <%@ Page UICulture="en"
    Culture="en-GB" %>

    To have ASP.NET set the UI culture and
    culture to the first language that is
    specified in the current browser
    settings, set UICulture and Culture to
    auto. Alternatively, you can set this
    value to auto:culture_info_name, where
    culture_info_name is a culture name.
    For a list of culture names, see
    CultureInfo. You can make this setting
    either in the @ Page directive or
    Web.config file.

    Alternative:

     CultureInfo.CurrentUICulture.DateTimeFormat
         = CultureInfo.CurrentCulture.DateTimeFormat
         = new CultureInfo( "en-GB", false ).DateTimeFormat;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

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.