473,387 Members | 3,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Wierd C# DateTime Parse Error..please help

We have a web service that gets data in xml format. In that Xml data, we
parse few date fields that are in this format

<data datefield="12/26/2008" timefield="16:33:45" ...>
we parse it into a DateTime field using DateTime.Parse( datefield ).Add(
TimeSpan.Parse( timefield ).

For some reason, on 26th of this month from 4pm to 5pm, for certain web
service calls, the date field was calculated incorrectly. Like a 12/26/2008
16:00:00 would be parsed as 12/27/2008 4:00:00. For some reason, the dates
were added by 12 hours automatically.

We have this code in production for a long..never found such an issue. It
happend only during the time mentioned above..and never before..and never
after. More
over, we have 2 servers in production, and this error happend on one of the
servers only. The other server processed the calls just fine.

We have same code deployed on both servers, and both these servers have same
configuration ( OS, patches and all ). Both these servers are identical.

Can you please tell me if you have faced such an issue before. I am not even
sure if its related to web service problem, or server problem, or database
problem.
The code was written in c#. Please let me know if you need more information.
thank you for your help..

Feb 29 '08 #1
1 3059
I've heard a roughly similar story. Can you determine if the caller is in a
different time zone when the call fails? There's a chance that it may be the
issue I've dealt with, basically a date deserialization issue.

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
-------------------------------------------------------

"avnrao" <av****@discussions.microsoft.comwrote in message
news:63**********************************@microsof t.com...
We have a web service that gets data in xml format. In that Xml data, we
parse few date fields that are in this format

<data datefield="12/26/2008" timefield="16:33:45" ...>
we parse it into a DateTime field using DateTime.Parse( datefield ).Add(
TimeSpan.Parse( timefield ).

For some reason, on 26th of this month from 4pm to 5pm, for certain web
service calls, the date field was calculated incorrectly. Like a
12/26/2008
16:00:00 would be parsed as 12/27/2008 4:00:00. For some reason, the dates
were added by 12 hours automatically.

We have this code in production for a long..never found such an issue. It
happend only during the time mentioned above..and never before..and never
after. More
over, we have 2 servers in production, and this error happend on one of
the
servers only. The other server processed the calls just fine.

We have same code deployed on both servers, and both these servers have
same
configuration ( OS, patches and all ). Both these servers are identical.

Can you please tell me if you have faced such an issue before. I am not
even
sure if its related to web service problem, or server problem, or database
problem.
The code was written in c#. Please let me know if you need more
information.
thank you for your help..
Mar 1 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Paul Beckett | last post by:
Does anyone know how to prevent an error when using DateTime.Parse? I am using it to format the display of dates in my database. However, some dates are empty and so I get an error when I try to...
11
by: Cor Ligthert | last post by:
Hello everybody, Jay and Herfried are telling me every time when I use CDate that using the datetime.parseexact is always the best way to do String to datetime conversions. They don't tell why...
11
by: Tim | last post by:
Hi, I am trying to do something simple. Convert a string date to datetime but it is not working and is giving me a baffling error! System.Convert.ToDateTime("Jan 30, 2006")...
11
by: Axel Dahmen | last post by:
Hi, I'm working in a team developing an international website. When I set the page's CultureInfo to Hungarian (hu-HU) then the RangeValidator doesn't seem to be able to parse a TextBox's date...
3
by: Rich Robinson | last post by:
Hi, I have a web service method which takes a DateTime type as a parameter. The service is UK based, and the dates are passed in to the service in the UK format dd/MM/yyyy. On a recent...
6
by: B.N.Prabhu | last post by:
Hi, I am having a DataTable which one column is in string format now i want to change that one to DataTime. I don't know whether its in datetime format or not i have to check if it is in...
5
by: js | last post by:
I have a textbox contains text in the format of "yyyy/MM/dd hh:mm:ss". I need to parse the text using System.DateTime.Parse() function with custom format. I got an error using the following code. ...
1
by: database | last post by:
I AM FACING A PROBLEM WHEN I ACCESS ONE OF THE PAGES. IT USED TO WORK BEFORE BUT AFTER RESTARTING THE APPLICATION SEVER IT GIVES THE FOLLOWING ERROR. - Server Error ...
0
by: =?Utf-8?B?YXZucmFv?= | last post by:
We have a web service that gets data in xml format. In that Xml data, we parse few date fields that are in this format <data datefield="12/26/2008" timefield="16:33:45" ...> we parse it into a...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.