Show / Hide Table of Contents

Class DateTimeExtensions

CSharp System.DateTime extension methods.

Inheritance
System.Object
DateTimeExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: StansAssets.Foundation.Extensions
Assembly: cs.temp.dll.dll
Syntax
public static class DateTimeExtensions

Methods

DateTimeToUnixTimestamp(DateTime)

Converts System.DateTime to unix timestamp with high precision

Declaration
public static double DateTimeToUnixTimestamp(DateTime dateTime)
Parameters
Type Name Description
System.DateTime dateTime

DateTime date representation.

Returns
Type Description
System.Double

unix timestamp that represents the same moment in time as provided DateTime object.

UnixTimestampToDateTime(Double)

Converts unix timestamp to System.DateTime with high precision.

Declaration
public static DateTime UnixTimestampToDateTime(double unixTime)
Parameters
Type Name Description
System.Double unixTime

Unix timestamp.

Returns
Type Description
System.DateTime

DateTime object that represents the same moment in time as provided Unix time.

In This Article
Back to top Generated by DocFX