Table of Contents

Class UnixDateConverter

Namespace
SunamoDateTime.Converters
Assembly
SunamoDateTime.dll

Unix timestamp converter. EN: Converts between DateTime and Unix timestamp (seconds since 1970-01-01). CZ: Převádí mezi DateTime a Unix timestampem (sekundy od 1970-01-01).

public class UnixDateConverter
Inheritance
UnixDateConverter
Inherited Members
Extension Methods

Methods

From(long)

Converts Unix timestamp to DateTime. EN: Creates DateTime by adding timestamp seconds to Unix epoch (1970-01-01 00:00:00). CZ: Vytvoří DateTime přidáním timestamp sekund k Unix epoch (1970-01-01 00:00:00).

public static DateTime From(long timestamp)

Parameters

timestamp long

Unix timestamp in seconds

Returns

DateTime

DateTime representation of the timestamp

To(DateTime)

Converts DateTime to Unix timestamp. EN: Returns number of seconds since Unix epoch (1970-01-01 00:00:00). CZ: Vrací počet sekund od Unix epoch (1970-01-01 00:00:00).

public static long To(DateTime dateTime)

Parameters

dateTime DateTime

The DateTime to convert

Returns

long

Unix timestamp in seconds