Skip to content

Commit 2cd5f03

Browse files
fix bug: interval value parsing
1 parent 5ec38b4 commit 2cd5f03

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Ydb.Sdk/src/Value/YdbValueParser.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Ydb.Sdk.Ado;
1+
using Google.Protobuf.WellKnownTypes;
2+
using Ydb.Sdk.Ado;
23

34
namespace Ydb.Sdk.Value;
45

@@ -96,7 +97,7 @@ public DateTime GetTimestamp()
9697
public TimeSpan GetInterval()
9798
{
9899
EnsurePrimitiveTypeId(Type.Types.PrimitiveTypeId.Interval);
99-
return TimeSpan.FromMilliseconds((double)_protoValue.Int64Value / 1000);
100+
return TimeSpan.FromTicks(_protoValue.Int64Value * (1000 / Duration.NanosecondsPerTick));
100101
}
101102

102103
public byte[] GetString()

0 commit comments

Comments
 (0)