How to set culture in web.config to change datetime format?

When you see the errors mentioned below in your web application while accessing it.

String was not recognized as a valid DateTime OR The conversion of a varchar data type to a DateTime data type resulted in an out-of-range value

You can fix such types of errors by adding the culture value In your web.config file as follows:

<globalization uiCulture="es" culture="es-MX" />

For further details, you can refer to the below link

 https://docs.microsoft.com/en-us/troubleshoot/aspnet/set-current-culture

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

SQL server- network related or instance-specific error happened while connection establishing

  Instance-specific or network related error happening while connecting to SQL server   Please...

OleDB connection string examples

OleDB connection string examples MS Access (Jet) "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA...

Do you allow custom COM components?

Do you allow custom COM components? We are not offering to install the custom COM components...

Error when accessing a WCF services

Error when accessing a WCF services Error when accessing a WCF service: "IIS specified...

How to cache static contents to client with UseMaxAge?

You can consider to caches static contents to the client with UseMaxAge if your website has too...

Powered by WHMCompleteSolution