Go Premium for a chance to win a PS4. Enter to Win


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

Posted on 2013-06-11
Medium Priority
Last Modified: 2013-06-21

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.

Question by:AidenA
  • 2
  • 2
LVL 18

Accepted Solution

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

Author Comment

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!
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.

Author Comment

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

963 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