I have a list, where one column is of type datetime and another a numeric value.
The records are being entered correctly, in the form:
ID Col01 Col02 01 05/02/2013 6 02 05/03/2013 9
Code I have used (snippet):
_item["_x0043_ol01"] = DateTime.Parse(mtbRecordDate.Text).AddDays(1).ToString("MM/dd/yyyy"); _item["_x0043_ol02"] = mtbNum.Text;
I am plotting these records in a graph using MSChart control, with dates on the horizontal axis and numeric values on the vertical axis. The graph is fine, and draws correctly.
But the date values it displays are wrong. It sometimes displays the correct date, at others it adds one to the date and then displays it. eg. record 02 plotted as 05/04/2013.
I've tried changing the format, and have crosschecked the values which are being passed to the graph. And they are correct.
Also, if I go back and delete the date, then enter it again, it plots correctly. Any idea why this happening? Any help is much appreciated.
PS: I'm in a timezone different from the server. Could that be the reason? The date is simply being stored as only the date, not the time or timezone.