DateTime value changes to something else if it is after 12:00 AM

Trips

Well-known member
Joined
Aug 7, 2010
Messages
2,788
Hello,
One computer (Client) that is connected to another computer (Server) is sending a wrong datetime value to the server and is stored in SQL Server as well. This problem happens if the Time is after 12 AM! Ths computer has Windows XP on it.
I have created a custom combo and use the Value property that has the code as follows:
<pre> public DateTime Value
{
get
{
if (this.textBox.Text.Trim() == string.Empty || this.comboBox.Value == null ||
this.comboBox.DateTime <= this.comboBox.MinDate)
return DateTime.MinValue;
//comboBox is the original DateTime combo
DateTime date = new DateTime(this.comboBox.DateTime.Year, this.comboBox.DateTime.Month,
this.comboBox.DateTime.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second, 0);
return date;
}
}[/code]

I am wondering if the language of the computer changes, will this may affect the value? The language of the server is English, but the language of the client could be something else? What else could be the problem?



View the full article
 
Back
Top