util

package
v0.0.0-...-379af47 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDate

func FormatDate(date string, separator string) string

FormatDate format date with separator 20160902 -> 2016-09-02

func GenerateID

func GenerateID(name, date string) string

GenerateID returns md5(张三20160812)

func GetDate

func GetDate(t time.Time) string

GetDate parse date from t and return in "20160822"

func GetToday

func GetToday() string

GetToday returns today's date in "20160822"

func GetWeekday

func GetWeekday(date string) (string, error)

GetWeekday returns '一' if time is Monday

func GetYesterday

func GetYesterday() string

GetYesterday returns yesterday's date in "20160821"

func PrintPretty

func PrintPretty(v interface{}, mark string) (err error)

PrintPretty prints struct v as format json

func SplitDate

func SplitDate(date string) (yyyy, mm, dd string)

SplitDate split date to year, month and day. 20160902 -> 2016 09 02

Types

This section is empty.

Jump to

Keyboard shortcuts

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