UtcMilliTime NuGet Package

Improve .NET to Unix time compatibility.

UtcMilliTime is for Windows devs to get timestamps in the Unix Time Milliseconds format, from a software defined clock that syncs with NTP (network) time.

In JavaScript, there is the Date.now() function. It yields Unix time * 1000 + milliseconds, or 'UtcMilliTime' for short. That format of timestamp is our goal. As it is UTC time - not localized - it is unambiguous (not subject to adjustment for time zone or daylight saving time).

As it is a whole number of milliseconds (integer), intervals (when expressed in milliseconds) can be added or subtracted to easily find the time immediately before or after the interval.

In .NET, the simple standard above becomes complicated. In common .NET projects, developers may feel it necessary to use .NET's DateTime, which counts ticks of a different precision in a different Epoch. It has been awkward to convert between these two formats as mentioned.

Now UtcMilliTime - an open source package on GitHub - brings the Time.Now idiom to .NET code running on Windows. It is open source, MIT licensed, and maintained by J.P.

Kusumi (at https://github.com/JPKusumi/UtcMilliTime).

Using UtcMilliTime, you can say var timestamp = Time.Now; and, it's a whole integer of the same scale and format as Date.now() in JavaScript. This component is not just a converter. It is a software defined clock that can reach out to an NTP (Network Time Protocol) server to synchronize itself with network time. It uses the Windows kernel, so this solution is only for running on Windows.




Got any UtcMilliTime Question?





Info

Version: 1.0.1
Author(s): John Kusumi
Last Update: Monday, October 28, 2019
.NET Fiddle: Create the first Fiddle
Project Url: https://github.com/JPKusumi/UtcMilliTime
NuGet Url: https://www.nuget.org/packages/UtcMilliTime


Install
Install-Package UtcMilliTime
dotnet add package UtcMilliTime
paket add UtcMilliTime
UtcMilliTime Download (Unzip the "nupkg" after downloading)



Tags



STATS

must-have-score

avg-downloads-per-day

0

days-since-last-release

1614