Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Datetime format issue in IIS 7 server

I have hosted one of my site on IIS 7, WS2008. Later i have realize there is some datetime format issue, like me expecting things in dd/MM/yyyy format but it was in MM/dd/yyyy format and because of this it used to give me datetime conversion error.

So i have changed the datetime format by following step:

Control Panel -> Regional and Language Options -> Advanced

and changed registry entry

regedit >> HKEY_USERS>>DEFAULT>>Control Panel>>International

and here we have changed "sLongDate" and "sShortDate" key in dd MM yyyy format

and restarted the server.

Now, the issue is if i create new website i'll found everything is working fine including my datetime format as well

But my actual site which i have created before making all these datetime setting changes is having no change at all, still i m facing same datetime issue.

So i have deleted that site and hosted same site again with same IP address and at same port, but still same issue.

So, is it like there is some configuration of datetime for specific port.

I can not change my port.

Please suggest me proper solution.

Thanks in Advance...

like image 847
Sham Avatar asked Jun 28 '12 03:06

Sham


People also ask

How do I change the date format in IIS 7?

Go to Control Panel. Click Region and you will see a screen with 3 tabs (Formats, Location and Administrative) Click Formats and choose the settings you prefer. Click Additional settings.

How do I change the date format on a server?

Open Control Panel, and then click Date, Time, Language, and Regional Options. Click Regional and Language Options. On the Regional Options tab, click Customize. On the Date tab, next to Short date format, select a short date format.

What is the default format of DateTime?

uses a default date format to store and manipulate strings that represent dates. To specify the default date format, enter a date format in the DateTime Format String attribute in the data viewer configuration. By default, the date format is MM/DD/YYYY HH24:MI:SS.US.


2 Answers

After lot's of hunt i have found the solution of my problem:

1) Change the datetime format of your server from:

Control Panel -> Regional and Language Options -> Advanced

2) Open IIS and follow below steps: (For IIS7)

- Click on you Website
- Select .NET GLOBALIZATION option
- From Culture tab, select required Culture and UI Culture.
- Finally iisreset.
- Dones....
like image 157
Sham Avatar answered Nov 15 '22 07:11

Sham


Change in registry entry

regedit >> HKEY_USERS >> DEFAULT >> Control Panel >> International

and we have changed "sLongDate" and "sShortDate" key in dd MM yyyy format

and restart server.

like image 35
Uday Gupta Avatar answered Nov 15 '22 07:11

Uday Gupta