Skip to content

Latest commit

 

History

History
50 lines (38 loc) · 824 Bytes

README.md

File metadata and controls

50 lines (38 loc) · 824 Bytes

fmtdate

Build Status

a simple go date formatter and parser, based on conventions of Microsoft Excel (TM)

Usage

	package main
	import (
		"github.com/metakeule/fmtdate"
		"fmt"
	)

	func main() {
		date := fmtdate.Format("DD.MM.YYYY", time.Now())
		fmt.Println(date)

		var err
		date, err = fmtdate.Parse("M/D/YY", "2/3/07")
		fmt.Println(date, err)
	}

Placeholders

hh   - hours
mm   - minutes
ss   - seconds
M    - month (1)
MM   - month (01)
MMM  - month (Jan)
MMMM - month (January)
D    - day (2)
DD   - day (02)
DDD  - day (Mon)
DDDD - day (Monday)
YY   - year (06)
YYYY - year (2006)

Documentation

see http://godoc.org/github.com/metakeule/fmtdate