datetime

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package datetime handles specific date and time processing for Discord.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(s string) string

Convert an input string with ISO timestamps into one that uses Unix timestamps.

Example
package main

import (
	"fmt"

	"bitbucket.org/idomdavis/etbot/datetime"
)

func main() {
	fmt.Println(datetime.Convert(`A sample set of timestamps to convert:
      Event A <t:1234567890:R>
      Event B <t:2021-12-20T13:14:04+00:00:D>
      Event C <t:2021-12-20T13:14:04Z>
      Event D <t:2021-12-20T12:14:04-01:00>
      Event E <t:Monday>`))

}
Output:

A sample set of timestamps to convert:
      Event A <t:1234567890:R>
      Event B <t:1640006044:D>
      Event C <t:1640006044>
      Event D <t:1640006044>
      Event E [Time TBC]

Types

This section is empty.

Jump to

Keyboard shortcuts

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