dateTimeUtil

package
v0.0.0-...-3f9575c Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

dateTimeUtil is a package providing some convenient functions that is date/time related.

Index

Constants

View Source
const (
	DefaultFormat = "2006-01-02 15:04:05"
)

DefaultFormat. Highly recommended not to change this. But if you know what you are doing, feel free to change it.

Variables

This section is empty.

Functions

func Format

func Format(datetime time.Time) string

Format to format the provided datetime time.Time into the string object.

func FormatCustom

func FormatCustom(datetime time.Time, format string) string

FormatCustom is like Format but take in a custom format parameter.

func GetCurrentDateTime

func GetCurrentDateTime() time.Time

GetCurrentDateTime to get the current date time.

func Parse

func Parse(datetime string) (*time.Time, error)

Parse to parse the provided datetime string into the time.Time object.

func ParseCustom

func ParseCustom(datetime string, format string) (*time.Time, error)

ParseCustom is like Parse but take in a custom format parameter.

Types

This section is empty.

Jump to

Keyboard shortcuts

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