468,514 Members | 1,655 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,514 developers. It's quick & easy.

Very strange date shifting issue on the ASP page

I have a strange date issue in the ASP application.

Application displays records from the database along with the record date

The same application is installed on two different servers. On both servers application points to the same SQL database accessing it through ODBC connection.

This happens on one server only. It doesn’t happen on another server with the same application.

If ASP app uses an internal Access database, dates look OK.
When application uses the external SQL database , displayed dates are shifted to the right on the second server:

04/06/2010 - correct date on the first server
06/20/0004 – displayed date is shifted right on the second server

When I pull dates manually using WinSQL and the same ODBC connection, dates look OK. How could this shifting happen, is it a server issue or application issue?
Apr 5 '10 #1
4 1473
3,405 Expert 2GB
looks like it could be a server issue. My first suggestion would be to always use a non-ambiguous data format (like 06-Apr-2010, etc) when you save into a db, because common numerical date formats are often not standardized.

What is the line of code that puts the date in the db? This might shed light on how 2 servers output two different lines for the same code.

Apr 5 '10 #2
I think you are right.

ODBC for server 2 – dates pulled incorrectly 3/29/2010 12:00:00 AM
SQL connection server 2 – dates pulled correctly 2010-03-29 00:00:00.000

ODBC and SQL for server 1 both dates are pulled correctly 2010-03-29 00:00:00.000

Those are new servers that were just set up by the local network guy. What should be changed in the ODBC settings to fix date problem, what is not set up correctly?
Apr 5 '10 #3
3,405 Expert 2GB
This is a regional setting deep within the sql server. Easiest to change the ASP script at the point where you save the date. If you post that line of code I can help give you a solution.

Apr 5 '10 #4
Thanks. Unfortunately I cannot touch or change that application, it's a third party masterpiece of art.

But I just found how to fix it. On the server where date was displayed incorrectly, I re-configured SQL connection in the ODBC.

I unchecked “Use regional settings when outputting currency, numbers, dates” in ODBC while reconfiguring connection and I got a correct date.

On the other server that checkbox is checked.

That means whoever set up two similar servers for load balancing, set them up differently, with different regional settings.

But the mystery with dates is solved :)
Apr 5 '10 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Igorati | last post: by
5 posts views Thread by Brian Blazer | last post: by
9 posts views Thread by Abby Lee | last post: by
2 posts views Thread by Tariq Ahmad | last post: by
1 post views Thread by tifoso | last post: by
12 posts views Thread by Boltar | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.