Back to

Package date

Latest Go to latest

The highest tagged major version is .

Published: Feb 6, 2020 | License: MIT | Module:


Package date implements encoding of 7 byte Oracle DATE storage formats.


type Date

type Date [7]byte

Date is an OCIDate

SQLT_ODT: 7 bytes

The internal format is the following one:

century + 100
year in the century + 100
hour + 1
minute + 1
second + 1

So in the previous example the date was 19-DEC-2007 at 22:35:10.

func FromTime

func FromTime(t time.Time) Date

FromTime returns a Date from a time.Time Does the allocation inside, so easier to use.

func (Date) Bytes

func (dt Date) Bytes() []byte

func (Date) Equal

func (dt Date) Equal(other Date) bool

func (Date) Get

func (dt Date) Get() time.Time

func (Date) GetIn

func (dt Date) GetIn(zone *time.Location) time.Time

func (Date) IsNull

func (dt Date) IsNull() bool

func (Date) MarshalJSON

func (dt Date) MarshalJSON() ([]byte, error)

func (*Date) Set

func (dt *Date) Set(t time.Time)

func (Date) String

func (dt Date) String() string

func (*Date) UnmarshalJSON

func (dt *Date) UnmarshalJSON(p []byte) error

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier