Casper.Network.SDK
Show / Hide Table of Contents

Class DateUtils

Helper class to convert dates from ISO strings to epoch timestamps and vice versa.

Inheritance
object
DateUtils
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Casper.Network.SDK.Utils
Assembly: Casper.Network.SDK.dll
Syntax
public class DateUtils

Methods

| Edit this page View Source

ToEpochTime(DateTime)

Converts a DateTime object to epoch timestamp.

Declaration
public static ulong ToEpochTime(DateTime datetime)
Parameters
Type Name Description
DateTime datetime
Returns
Type Description
ulong
| Edit this page View Source

ToEpochTime(string)

Converts an ISO formatted date string to epoch timestamp.

Declaration
public static ulong ToEpochTime(string datetime)
Parameters
Type Name Description
string datetime
Returns
Type Description
ulong
| Edit this page View Source

ToISOString(ulong)

Converts an epoc timestamp (in milliseconds) to an ISO formatted date string.

Declaration
public static string ToISOString(ulong epochTimeInMillis)
Parameters
Type Name Description
ulong epochTimeInMillis
Returns
Type Description
string
  • Edit this page
  • View Source
In this article
Back to top Maintained by MAKE Technology LLC