Apologies if this is common knowledge but I have an answer to the SQL Server date time bug, which has been haunting me for 3 days. This applies to the .NET problem. Even if you set SQL Server to UK and all the Server Regional Settings are UK but the website output the date time to mm/dd/yyyy hh:mm AM/PM this is what you can try:
-----------------------------------------------------
GOTO:- C:\WINDOWS\Microsoft.NET\Framework\v1.x\CONFIG
EDIT:- machine.conf
CHANGE:-
from: <globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
to: <globalization requestEncoding="utf-8" culture="en-GB" uiCulture="en-GB" responseEncoding="utf-8"/>
-----------------------------------------------------
You should know see the datetime in the following format
DD/MM/YYYY HH:MM:SS (24hr)
It because if you have installed the framework on a server which is set initially to UK the system config for .NET sets itself to UK. However if you then migrate the server to a US based server (which is what we had done), the framework system is by default set to US.
By making the change to the machine.conf file all subsequent .net applications will be set to UK. If you wish to only apply this to one application/website you must override the system datetime setting in the cs classes, by changing the DateTimeHandler class which is part of the System.Globalization assembly.
|