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 7161975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:39:30+00:00 2026-05-28T13:39:30+00:00

My application is setted with pt-BR culture (Date is dd-mm-yyyy) in web.config: <globalization enableClientBasedCulture=false

  • 0

My application is setted with pt-BR culture (Date is dd-mm-yyyy) in web.config:

<globalization enableClientBasedCulture="false" requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="iso-8859-15" responseHeaderEncoding="utf-8" resourceProviderFactoryType="string" enableBestFitResponseEncoding="true" culture="pt-BR" uiCulture="pt-BR" />

All DateTime created on my system is in right format, but I created a controller method like that:

public ActionResult Test(DateTime date)
{
}

Calling that method direct in the browser is passing null when the date is with portuguese-br format, like that:

mysite/Test/?date=19/01/2012   => date = null in my controller

mysite/Test/?date=01/01/2012   => date is fine, but in US format (mm-dd-yyyy)

How can I fix that, to accept my date format?

  • 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-28T13:39:31+00:00Added an answer on May 28, 2026 at 1:39 pm

    There’s a gotcha with the default model binder that is not easy to know about but once you know it you no longer make the same mistake:

    • When you use a POST request, the default model binder uses your culture settings to parse the dates.

    • When you use a GET request, the default model binder uses CultureInfo.InvariantCulture to parse the dates and ignores your current culture settings.

    Since you are using a GET request and passing the date as a query string parameter, you should format it using the invariant culture format when sending it in the url. The correct way to format your date as a query string parameter is yyyy-MM-dd.

    You may take a look at the following blog post which gets into more details.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got a web application using the spring-security framework. I setted up a database
Application is running in my local system app.config file <add key=dbconn value=Data Source=(local);database=VTech;User ID=sa;Password=sa;
Application launch through Java web start(JWS) checks for update when we are launching it.
I'm dealing with some sort of problem here. A web application built on java
I have Silverlight 3 application with two datepickers for Start Date and End Date.
I have this configuration on my web application. 2 beans : 1° Bean -
I have big web application using JQuery UI Tabs. In central JS file I
I'm developing an web application with asp.net and c#. I have a textbox in
I am modifying a form component that is part of a web application to
I really am feeling bad. I have one web application that sends Emails for

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.