Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

one date appearing in american format in production - cannot replicate in devolpment

Posted on 2013-06-11
5
Medium Priority
?
235 Views
Last Modified: 2013-06-21
Hi,

This could be very specific to our code, but I have a date which is being updated in a textbox as, say, 09/06/2000 but then returned as 06/09/2000. Other dates are being sent and returned correctly, so there is something different about this particular situation. The code is kind of complex and I can't post any anyway (it is classic asp by the way) and the server is SQL Server, and it does use the function like CONVERT(varchar(10), myDate, 103) to return both the dates that are working fine and the one that isn't (in different procedures).

Since there is so much code, tables, stored procedures etc it is hard to track exactly what is going where but currently I can't see why this would happen. So, just in case someone has any ideas I thought I would try and ask this question!

The globalization has been set on the server and on the websites web.config as english so at this stage it doesn't look so much like a globalization issue and since some dates work fine that would back that up. So, must be something somewhere specific to that textbox and data.

Aiden
0
Comment
Question by:AidenA
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 18

Accepted Solution

by:
Jerry Miller earned 2000 total points
ID: 39238233
Probably the only way to find it is to "track exactly what is going where" to see the data flow.

First, execute the stored procedures or queries using the variable values and verify the results.

Next, make sure that the  format is not being changed on the display page only, by simply verifying it against a working one.

Next you will have to put in breakpoints and follow the date value until it changes.

I understand you not being able to post code, I can't post work code either.
0
 
LVL 70

Expert Comment

by:Scott Pletcher
ID: 39238679
Each PC will also have its own local date settings.

Maybe the local date setting on that PC is different from what is "normal" for your environment.
0
 

Author Comment

by:AidenA
ID: 39241882
Hey, I've gone through all the code and can't see any issue. As I was saying, I can't replicate in development... and also there is no possibility to debug anything. This is a very old classic asp application and we can't debug it, we can only use response.write to the screen to see what is happening as the website is running. Pretty ridiculous but there you go. No one has gotten around to trying to get this working in debug mode.

So, we can't step through production either. I think I've ruled out the database as the issue as the data entering and leaving the stored procedures seem ok. in fact, what we have here is that when the user clicks the submit button on the form, the date is sent to the database and is saved in the reverse order (mm and dd switched).

Is it possible to view the date (say using IE developer tools (I think IE can only be used for this site)) before it is sent to the server to see what it looks like then. Actually, I think maybe I can do that with fiddler right... might try and check that tomorrow... if you've any other ideas throw them at me!
0
 
LVL 18

Expert Comment

by:Jerry Miller
ID: 39242435
If you suspect that it is being changed on the submit button, you can look at the database field where it is being saved to verify. Then take a look at the button code to see what format it is sending. Also look at that query / stored procedure to make sure it formatting correctly. That is a much better approach than looking through all of them. There has to be some difference between your development and production environments.

Fiddler would let you see the values, so you can see where in the process it is occurring. I would never suggest stepping through production code, that is why development is used. If it works fine in dev there could be a setting on the web server, but it is only on one textbox and not all of them so I doubt that is the issue.
0
 

Author Comment

by:AidenA
ID: 39266178
ok I think I solved this one and nobody would have gotten it really, or at least it wasn't obvious. Seems that ADO.NET was doing some kind of implicit conversion. The date was being passed in as a string but then, because the query was using parameters it was being implicitly converted to some kind of date parameter.

Because it's ADO.NET i can only assume that maybe some kind of IIS setting looks after this or it is somehow dependent on the user logged in... don't know really but seems to be sorted.

thanks for suggestions anyhow
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question