Class SnowflakeUtils
Provides a series of helper methods for handling snowflake identifiers.
Inheritance
System.Object
SnowflakeUtils
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Discord
Assembly: Discord.Net.Core.dll
Syntax
public static class SnowflakeUtils
Methods
| Improve this Doc View SourceFromSnowflake(UInt64)
Resolves the time of which the snowflake is generated.
Declaration
public static DateTimeOffset FromSnowflake(ulong value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | value | The snowflake identifier to resolve. |
Returns
| Type | Description |
|---|---|
| System.DateTimeOffset | A System.DateTimeOffset representing the time for when the object is geenrated. |
ToSnowflake(DateTimeOffset)
Generates a pseudo-snowflake identifier with a System.DateTimeOffset.
Declaration
public static ulong ToSnowflake(DateTimeOffset value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.DateTimeOffset | value | The time to be used in the new snowflake. |
Returns
| Type | Description |
|---|---|
| System.UInt64 | A System.UInt64 representing the newly generated snowflake identifier. |