dateutils

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package dateutils provides functions to work with dates.

Index

Examples

Constants

View Source
const Iso8601DateFormat = "2006-01-02"

Iso8601DateFormat is the ISO 8601 date format without time.

Variables

This section is empty.

Functions

func GetDateFromDateParts

func GetDateFromDateParts(dateAsParts [][]int) string

GetDateFromDateParts returns a date string from date parts

func GetDateFromParts

func GetDateFromParts(parts ...int) string

GetDateFromParts returns a date string from parts

func GetDateFromUnixTimestamp

func GetDateFromUnixTimestamp(timestamp int64) string

GetDateFromUnixTimestamp returns a date string from a Unix timestamp

Example
package main

import (
	"fmt"

	"github.com/front-matter/commonmeta/dateutils"
)

func main() {
	s := dateutils.GetDateFromUnixTimestamp(1611312000)
	fmt.Println(s)
}
Output:
2021-01-22

Types

This section is empty.

Jump to

Keyboard shortcuts

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