datetime

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2018 License: MIT Imports: 4 Imported by: 2

README

datetime

GoDoc Build Status

Date & time serialization, comparison and other common operations.

Install
go get github.com/altipla-consulting/datetime
Contributing

You can make pull requests or create issues in GitHub. Any code you send should be formatted using gofmt.

Running tests

Run the tests

make test
License

MIT License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiffDays

func DiffDays(a, b time.Time) int64

DiffDays returns the difference between the two dates in days.

func ParseDate

func ParseDate(date *pbdatetime.Date) time.Time

ParseDate converts a proto to Go time.Time.

func ParseTimestamp

func ParseTimestamp(timestamp *pbtimestamp.Timestamp) time.Time

ParseTimestamp converts a proto to Go time.Time.

func SerializeDate

func SerializeDate(t time.Time) *pbdatetime.Date

SerializeDate converts a Go time.Time to proto considering only the date part.

func SerializeTimestamp

func SerializeTimestamp(t time.Time) *pbtimestamp.Timestamp

SerializeTimestamp converts a Go time.Time to proto.

func TimeToDate

func TimeToDate(t time.Time) time.Time

TimeToDate returns the remaining time to reach the date.

Types

This section is empty.

Directories

Path Synopsis
altipla

Jump to

Keyboard shortcuts

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