Skip to main content

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​
TypeNameDescription
System.UInt64valueThe 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​
TypeNameDescription
System.DateTimeOffsetvalueThe time to be used in the new snowflake.