0

in our search and business process in the site we depend on date format dd/mm/yyyy and time format HH:MM

but I discovered that the site and hosting server date format look like M/dd/yyyy H:MM PM/AM.

I tried to use the following in web.config to override that but I failed

    <globalization
   requestEncoding="utf-8"
   responseEncoding="utf-8"
   culture="en-GB"
   uiCulture="es" />

any other ideas to solve that , I don't have access on the server to change the date , it's godaddy hosting

Prajna Rai T
  • 1,666
  • 3
  • 15
Ali
  • 1,975
  • 5
  • 36
  • 55
  • Try this http://stackoverflow.com/questions/2468312/setting-a-date-format-in-asp-net-web-config-globalization-tag – aravind Aug 23 '12 at 02:15

3 Answers3

0

You will not be able to overwrite any server settings with your web.config. However, in your code you can format the datetime string that way. You can see more on how to do this here: http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx

Mike_GoDaddy
  • 1,121
  • 1
  • 7
  • 9
0

Date and string conversions can be a long modification, and be a bit messy. Add the below to your web.config. Be careful not to add duplicate globalization or system.web tags.

<system.web>
<globalization  culture="en-NZ"  uiCulture="en-NZ"/>
</system.web>

Tested in ASP.NET 4.5 GoDaddy host and it works.

Josh Harris
  • 446
  • 4
  • 8
0

As Josh Harris mentions, add configuration in web config:

<system.web>
  <globalization  culture="es"  uiCulture="es-MX"/>
</system.web>

It worked for me for website hosting in goDaddy -

Ramil Aliyev 007
  • 4,437
  • 2
  • 31
  • 47