A simple and non intrusive epoch tool for .net
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Epoch.net.Tests
Epoch.net
.gitignore
CHANGELOG.md
Epoch.net.sln
LICENSE
README.md
appveyor.yml

README.md

epoch.net

A simple non intrusive epoch calculation thing.

Motivation

In reality this is a siteproduct of the openTSDB.net project. After implementing it as part of the aforementioned project I found it to usefull to just be a internall code artefact.

Usage

DateTime => Epoch

To get a unix epoch representation of a DateTime Object

var epochNow = DateTime.Now.AsEpoch();

or

var epochNow = DateTime.UtcNow.AsEpoch();

or

var epochNow = Epoch.Now;

or

var epochNow = new Epoch(DateTime.Now).AsEpoch;

Epoch => DateTime

var dateTime = 0l.AsDateTime();

or

var dateTime = 0l.AsDateTime();