mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-16 17:23:38 -05:00
This reverts commit 431dfa4156.
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user