Very strange date shifting issue on the ASP page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LARwoman
    New Member
    • Apr 2010
    • 3

    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?
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    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.

    Jared

    Comment

    • LARwoman
      New Member
      • Apr 2010
      • 3

      #3
      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?

      Comment

      • jhardman
        Recognized Expert Specialist
        • Jan 2007
        • 3405

        #4
        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.

        Jared

        Comment

        • LARwoman
          New Member
          • Apr 2010
          • 3

          #5
          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 :)

          Comment

          Working...