btdate

package
v0.0.0-...-4781f84 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Date

type Date struct {
	Day   int
	Month time.Month
	Year  int
}

Date is the braintree date.

All dates are in UTC and other timezones are converted to and from UTC on all conversions.

func FromTime

func FromTime(t time.Time) Date

FromTime converts time.Time into a Date.

func Parse

func Parse(value string) (Date, error)

Parse a Date in the format YYYY-MM-DD.

func Today

func Today() Date

Today returns the current day.

func (Date) MarshalText

func (d Date) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface.

func (Date) String

func (d Date) String() string

String implements the Stringer interface.

func (Date) Time

func (d Date) Time() time.Time

Time converts a Date into time.Time.

func (*Date) UnmarshalText

func (d *Date) UnmarshalText(data []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

Jump to

Keyboard shortcuts

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