snowflake

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package snowflake provides functions for acting on Discord snowflakes.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Timestamp

func Timestamp(snowflake string) time.Time

Timestamp will return the timestamp embedded in a snowflake. Failure to parse the snowflake will result in the current time being returned.

Example
package main

import (
	"fmt"

	"bitbucket.org/idomdavis/discordance/snowflake"
)

func main() {
	fmt.Println(snowflake.Timestamp("943865945699532811").Unix())

}
Output:

1645105577

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL