Revert "Adding Milliseconds to DateTime fields (#173)" (#197)

This reverts commit 431dfa4156.
This commit is contained in:
Benjamin Russell
2016-12-16 16:37:32 -08:00
committed by GitHub
parent d10c9c4cae
commit 0bee0147d9
5 changed files with 45 additions and 126 deletions

View File

@@ -260,26 +260,11 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.DataStorage
/// <returns>A DateTime</returns>
public FileStreamReadResult ReadDateTime(long offset)
{
int precision = 0;
return ReadCellHelper(offset,
length =>
{
precision = BitConverter.ToInt32(buffer, 0);
long ticks = BitConverter.ToInt64(buffer, 4);
return new DateTime(ticks);
}, null,
time =>
{
string format = "yyyy-MM-dd HH:mm:ss";
if (precision > 0)
{
// Output the number milliseconds equivalent to the precision
// NOTE: string('f', precision) will output ffff for precision=4
format += "." + new string('f', precision);
}
return time.ToString(format);
});
return ReadCellHelper(offset, length =>
{
long ticks = BitConverter.ToInt64(buffer, 0);
return new DateTime(ticks);
});
}
/// <summary>