C# Class CSharpAnalytics.Protocols.EpochTime

Represents a date and time expressed as the number of seconds since 00:00 on 01-Jan-1970.
Mostra file Open project: TechSmith/CSharpAnalytics Class Usage Examples

Public Methods

Method Description
EpochTime ( DateTimeOffset offset ) : System

Create a new EpochTime from an existing DateTimeOffset.

EpochTime ( ulong secondsSince1970 ) : System

Create a new EpochTime with a given number of seconds since the start of 1970.

ToDateTimeOffset ( ) : DateTimeOffset

Return an EpochTime as a DateTimeOffset.

ToString ( ) : string

Return a string containing the number of seconds since 1970.

ToUtcString ( ) : string

Return a string with the EpochTime represented as a UTC date format.

TryParseSeconds ( string seconds, EpochTime &epochTime ) : bool

Try and parse a string representing seconds into an EpochTime.

Method Details

EpochTime() public method

Create a new EpochTime from an existing DateTimeOffset.
public EpochTime ( DateTimeOffset offset ) : System
offset DateTimeOffset
return System

EpochTime() public method

Create a new EpochTime with a given number of seconds since the start of 1970.
public EpochTime ( ulong secondsSince1970 ) : System
secondsSince1970 ulong Number of seconds since the start of 1970.
return System

ToDateTimeOffset() public method

Return an EpochTime as a DateTimeOffset.
public ToDateTimeOffset ( ) : DateTimeOffset
return DateTimeOffset

ToString() public method

Return a string containing the number of seconds since 1970.
public ToString ( ) : string
return string

ToUtcString() public method

Return a string with the EpochTime represented as a UTC date format.
public ToUtcString ( ) : string
return string

TryParseSeconds() public static method

Try and parse a string representing seconds into an EpochTime.
public static TryParseSeconds ( string seconds, EpochTime &epochTime ) : bool
seconds string String containing number of seconds since start of 1970.
epochTime EpochTime Output parameter containing new EpochTime
return bool