reldate

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2016 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package reldate generates a date in YYYY-MM-DD format based on a relative time description (e.g. -1 week, +3 years)

@author R. S. Doiel, <rsdoiel@gmail.com> copyright (c) 2014 all rights reserved. Released under the Simplified BSD License See: http://opensource.org/licenses/bsd-license.php

Index

Constants

View Source
const (
	// The standard format for dates I find convient
	YYYYMMDD = "2006-01-02"
	// Version of this package
	Version = "v0.0.2"
)

Variables

This section is empty.

Functions

func EndOfMonth

func EndOfMonth(t1 time.Time) string

finds the end of the month value (e.g. 28, 29, 30, 31)

func RelativeTime

func RelativeTime(t time.Time, i int, u string) (time.Time, error)

RelativeTime takes a time, an integer ammount (positive or negative) and a unit value (day of week, days, weeks, month, years) and computes the relative time in days from time returning a new time and error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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