Date format problem with different servers

I have the following date in my DB:   2014-07-31 00:00:00.000

I use ASP to format it when displayed:   <%= ((ContactDetails.Fields.Item("ExpiresOn").Value)) %>

On my live server its all good. It shows:  07/31/2014

But the exact same DB (restored from server) in my local environment when I open the page it shows:  31/07/2014

What configuration on my SQL Server could be different to cause this issue ?

It is the exact same ASP code, the exact same DB. The only difference its where the DB is. Both are MS SQL 2008 servers.
LVL 1
AleksAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Anoo S PillaiCommented:
Compare date settings in Region and Language as well as Date and Time formats.
0
AleksAuthor Commented:
Where can I find this settings ?
0
Anoo S PillaiCommented:
Depends on operating system - For refer following link for Windows 7
http://windows.microsoft.com/en-in/windows/change-system-locale#1TC=windows-7

Which is your OS ?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Éric MoreauSenior .Net ConsultantCommented:
You can surely specify the format:
<%= ((ContactDetails.Fields.Item("ExpiresOn").Value.ToString('MM/dd/yyyy"))) %>

Open in new window

0
Anoo S PillaiCommented:
What Éric Moreau posted could be the right solution.
Else you may face the same issue again if settings are changed / connected to a different server with different settings.

Anoo
0
AleksAuthor Commented:
Its not Windows actually. Pretty odd. Different DB on the same local computer shows the correct date. This imported database SAME table, SAME field, displays dd/mm/yyyy

sigh.
0
Éric MoreauSenior .Net ConsultantCommented:
>>This imported database SAME table, SAME field, displays dd/mm/yyyy

The format that is stored is independent of the display format. You should never rely on the display and always force it to whatever you want in your presentation layer.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AleksAuthor Commented:
what I am saying without any formatting the SAME exact date in one server shows one format and a different on another server. So it is evidently NOT an issue with the data.

It is also not an issue with the SQL server itself because another database in the same SQL server (local) shows dates in the correct format.

Its this ONE database that is not showing the dates in the correct format. very weird. I give up.
0
Éric MoreauSenior .Net ConsultantCommented:
Are you using the same collation on both databases?
0
AleksAuthor Commented:
Yes
0
Éric MoreauSenior .Net ConsultantCommented:
are you sure all your date fields have a real date time datatype and that some are not stored as a string?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.