Project Description

This library provides a System.UnixTime as a new Type providing conversion between Unix Time and .NET DateTime.

Unix Time includes a .NET Type Converter and a JSON Type Converter for Newtonsoft.Json.

What is Unix Time?

On a Unix system time is stored as the number of second that have elapsed since Thursday, 1 January 1970 midnight UTC. This date and time is called the Unix Epoch.

If you have worked with a Drupal web site, for example, you find that Drupal stores dates in the database as a Unix Time Stamp. The date of Saturday, August 2nd, 2014 7:18:46 AM CST is stored as 1406981926. When working in .NET it is convenient to work with these values as DateTime objects, but of course, when you send them back to the database they need to return to their original format as a Unix Time.

Unix Time provides a simple way to convert back and forth between these formats.

On a 32-bit system the maximum date and time that can be specified is January 19, 2038 03:14:07 GMT.

This library has a limit of 253402300799.0 which is 12/31/9999 11:59:59 UTC.

Working with Unix Time

When working with application or databases on a Unix platform you will often run into the situation where you need to convert between a Unix time and a .NET DateTime. Although this conversion can be trivial to some, this library provides a simple mechanism for conversion.

Last edited Aug 2, 2014 at 5:40 PM by porrey, version 10