Class SnowflakeUtils
Provides a series of helper methods for handling snowflake identifiers.
Assembly: Discord.Net.Core.dll​
View Source​
Declaration
public static class SnowflakeUtils
Methods​
FromSnowflake(UInt64)​
Resolves the time of which the snowflake is generated.
View Source​
Declaration
public static DateTimeOffset FromSnowflake(ulong value)
Returns​
System.DateTimeOffset
:
A System.DateTimeOffset
representing the time for when the object is generated.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | value | The snowflake identifier to resolve. |
ToSnowflake(DateTimeOffset)​
Generates a pseudo-snowflake identifier with a System.DateTimeOffset
.
View Source​
Declaration
public static ulong ToSnowflake(DateTimeOffset value)
Returns​
System.UInt64
:
A System.UInt64
representing the newly generated snowflake identifier.
Parameters​
Type | Name | Description |
---|---|---|
System.DateTimeOffset | value | The time to be used in the new snowflake. |