Solved

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

Posted on 2013-06-11
5
226 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
  • 2
  • 2
5 Comments
 
LVL 18

Accepted Solution

by:
Jerry Miller earned 500 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 69

Expert Comment

by:ScottPletcher
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

920 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now