I just found that my SqlDateTime.MinValue is different on different machines.
Sometimes it is = DateTime(1953, 1, 1, 0, 0, 0);
but on other machines it is = DateTime(1753, 1, 1, 0, 0, 0);
How can that be? OS on both machines is WinXP SP2.
Edit:
My code was like this:
DateTime date;
...
if (date == SqlDateTime.MinValue)
{
return "(any)";
}
else
{
return date.ToString();
}
This code should never return January 1, 1753 but it did (on some machines). The minutes and seconds of date are not used by my code and should always remain default values.
I know this issue happened on old Windows NT machines, where the date range was 1953-XXXX, instead of 1753-9999. Are you totally sure that these machines are both running Windows XP?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With