Skip to content

Commit

Permalink
Fix for issue #23
Browse files Browse the repository at this point in the history
  • Loading branch information
Alberto Massari committed Aug 20, 2015
1 parent 866ad0d commit f51da5a
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions NuoDb.Data.Client/EncodedDataStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -704,17 +704,9 @@ public virtual void encodeTimestamp(DateTime val)
}

TimeSpan delta = val.ToUniversalTime() - baseDate;

long value = (long)((delta.TotalMilliseconds * 1000) * 1000000000); // convert to nanoseconds
long value = delta.Ticks * NANOSECONDS_PER_TICK; // convert to nanoseconds
int count = byteCount(value);

if (value >= edsIntMin && value <= edsIntMax)
{
write(edsNanoSecLen0 + (int)value);

return;
}

write(edsNanoSecLen1 + count - 1);

for (int shift = (count - 1) * 8; shift >= 0; shift -= 8)
Expand Down

0 comments on commit f51da5a

Please sign in to comment.