C# Class Netsy.Helpers.DateTimeHelpers

Extension methods on dates and times
显示文件 Open project: AnthonySteele/Netsy

Public Methods

Method Description
ToDateTimeFromEpoch ( this epochTime ) : System.DateTime

Convert a numeric epoch time to a .Net DateTime

ToDateTimeFromEpoch ( this epochTime ) : DateTime?

Convert a numeric epoch time to a .Net DateTime catering for nulls

ToEpochFromDateTime ( this dateTime ) : double

Convert a .Net DateTime to an epoch time

ToEpochFromDateTime ( this dateTime ) : double?

Convert a .Net DateTime or null to an epoch time

Method Details

ToDateTimeFromEpoch() public static method

Convert a numeric epoch time to a .Net DateTime
public static ToDateTimeFromEpoch ( this epochTime ) : System.DateTime
epochTime this the count of seconds since 1970
return System.DateTime

ToDateTimeFromEpoch() public static method

Convert a numeric epoch time to a .Net DateTime catering for nulls
public static ToDateTimeFromEpoch ( this epochTime ) : DateTime?
epochTime this the count of seconds since 1970
return DateTime?

ToEpochFromDateTime() public static method

Convert a .Net DateTime to an epoch time
public static ToEpochFromDateTime ( this dateTime ) : double
dateTime this the datetime value
return double

ToEpochFromDateTime() public static method

Convert a .Net DateTime or null to an epoch time
public static ToEpochFromDateTime ( this dateTime ) : double?
dateTime this the datetime value
return double?