Skip to content

Commit

Permalink
2010-07-07 Veerapuram Varadhan <vvaradhan@novell.com>
Browse files Browse the repository at this point in the history
	** Fixes #609109 - DateTime part
	* TdsComm.cs (Append[DateTime]): More fix for handling SqlServer
	MinValue for DateTime.

svn path=/branches/mono-2-6/mcs/; revision=159987
  • Loading branch information
vvaradhan committed Jul 7, 2010
1 parent 7c28038 commit ddd7c37
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 6 additions & 0 deletions mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2010-07-07 Veerapuram Varadhan <vvaradhan@novell.com>

** Fixes #609109 - DateTime part
* TdsComm.cs (Append[DateTime]): More fix for handling SqlServer
MinValue for DateTime.

2010-07-06 Veerapuram Varadhan <vvaradhan@novell.com>

** Fixes #609109
Expand Down
12 changes: 7 additions & 5 deletions mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsComm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,13 @@ public void Append (DateTime t, int bytes)
msecs = span.Milliseconds;

if (epoch > t) {
hours = t.Hour;
minutes = t.Minute;
secs = t.Second;
msecs = t.Millisecond;
days--;
// If t.Hour is > 0, days points to the next day and hence,
// we move it back by a day - otherwise, no change
days = (t.Hour > 0 || t.Minute > 0 || t.Second > 0 || t.Millisecond > 0) ? days-1: days;
hours = t.Hour;
minutes = t.Minute;
secs = t.Second;
msecs = t.Millisecond;
}

SendIfFull (bytes);
Expand Down

0 comments on commit ddd7c37

Please sign in to comment.