mono / mono.posix

POSIX/Unix interface for Mono, .NET and .NET Core. Provides functionality for managed code to access POSIX/Unix features not accessible via the BCL. This repository supersedes the older code in https://github.com/mono/mono
MIT License
42 stars 10 forks source link

NativeConvert.ToDateTime handles nanoseconds incorrectly #21

Closed rosenqui-cysiv closed 2 years ago

rosenqui-cysiv commented 2 years ago

NativeConvert.ToDateTime should divide the nanoTime component by 1000000 when converting to milliseconds rather than 1000.

From Mono.Unix.Native/NativeConvert.cs:

public static DateTime ToDateTime (long time, long nanoTime)
{
    return FromTimeT (time).AddMilliseconds (nanoTime / 1000);
}