Cave.UnixTime 1.0.0

Provides functions and interop for unix timestamps 32bit unsigned and 64bit signed

There is a newer prerelease version of this package available.
See the version list below for details.
Install-Package Cave.UnixTime -Version 1.0.0
dotnet add package Cave.UnixTime --version 1.0.0
<PackageReference Include="Cave.UnixTime" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Cave.UnixTime --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

cave-unixtime

Cave.UnixTime is a .NET DateTime compatible implementation of the unix time_t32 and time_t64 structures and can be used within marshaled structs for interop.

Package

A package is available at nuget.org

Master

The primary repo for the project is on GitHub and this is where the wiki and issues are managed from.

Licence

All original software is licensed under the LGPL-3 Licence. This does not apply to any other 3rd party tools, utilities or code which may be used to develop this application.

If anyone is aware of any licence violations that this code may be making please inform the developers so that the issue can be investigated and rectified.

Building

You will need:

  1. Visual Studio VS2017 (Community Edition) or later
  2. Target Framework packs:
    • netstandard1.0
    • netstandard1.3
    • netstandard2.0
    • netcoreapp1.0
    • netcoreapp2.0
    • net20
    • net35
    • net40
    • net45
    • net46
    • net47

First use

You can use UnixTime32 at most places you are currently using DateTime and can convert one to another.
UnixTime64 implements the same properties, operators and functions UnixTime32 does.

var unixTime32 = UnixTime32.Now;
DateTime dateTime = unixTime32.DateTime;
//29. Sept. 2018 - 16:35
unixTime32 = 1538231700;
//add 10 seconds
unixTime32 += 10;
//add a timespan
unixTime32 += TimeSpan.FromSeconds(10);

To use in an interop struct simply define the field. It will be marshaled as uint (UnixTime32) or long (UnixTime64).

cave-unixtime

Cave.UnixTime is a .NET DateTime compatible implementation of the unix time_t32 and time_t64 structures and can be used within marshaled structs for interop.

Package

A package is available at nuget.org

Master

The primary repo for the project is on GitHub and this is where the wiki and issues are managed from.

Licence

All original software is licensed under the LGPL-3 Licence. This does not apply to any other 3rd party tools, utilities or code which may be used to develop this application.

If anyone is aware of any licence violations that this code may be making please inform the developers so that the issue can be investigated and rectified.

Building

You will need:

  1. Visual Studio VS2017 (Community Edition) or later
  2. Target Framework packs:
    • netstandard1.0
    • netstandard1.3
    • netstandard2.0
    • netcoreapp1.0
    • netcoreapp2.0
    • net20
    • net35
    • net40
    • net45
    • net46
    • net47

First use

You can use UnixTime32 at most places you are currently using DateTime and can convert one to another.
UnixTime64 implements the same properties, operators and functions UnixTime32 does.

var unixTime32 = UnixTime32.Now;
DateTime dateTime = unixTime32.DateTime;
//29. Sept. 2018 - 16:35
unixTime32 = 1538231700;
//add 10 seconds
unixTime32 += 10;
//add a timespan
unixTime32 += TimeSpan.FromSeconds(10);

To use in an interop struct simply define the field. It will be marshaled as uint (UnixTime32) or long (UnixTime64).

  • .NETCoreApp 1.0

  • .NETCoreApp 2.0

    • No dependencies.
  • .NETFramework 2.0

    • No dependencies.
  • .NETFramework 3.5

    • No dependencies.
  • .NETFramework 4.0

    • No dependencies.
  • .NETFramework 4.5

    • No dependencies.
  • .NETFramework 4.6

    • No dependencies.
  • .NETFramework 4.7

    • No dependencies.
  • .NETStandard 1.0

  • .NETStandard 2.0

    • No dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.1-ci-20190309-1 82 3/9/2019
1.0.1-ci-20190308-2 85 3/8/2019
1.0.1-ci-20190308-1 90 3/8/2019
1.0.0 147 9/29/2018