Help us shape the future of Go! Take the 2026 Go Developer Survey

mydate

package module
v0.0.0-...-ff9bf7b Latest Latest
Warning

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

Go to latest
Published: May 7, 2019 License: MIT Imports: 1 Imported by: 0

README

mydate

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DateFormatLayout = "02/01/2006"

DateFormatLayout for use in Time.Format

View Source
var DatetimeFormatLayout = "02/01/2006 15:04:05"

DatetimeFormatLayout for use in Time.Format

View Source
var Location, _ = time.LoadLocation("Local")

Location by default for generating time.Time objects

Functions

This section is empty.

Types

type Date

type Date string

Date is a date in MySQL format

func CurrentDate

func CurrentDate() Date

CurrentDate returns the current date

func (Date) Format

func (d Date) Format() string

Format returns a textual representation of the time value formatted according to layout, which defines the format by showing how the reference time, defined to be

Mon Jan 2 15:04:05 -0700 MST 2006

would be displayed if it were the value; it serves as an example of the desired output. The same display rules will then be applied to the time value.

func (Date) Time

func (d Date) Time() (time.Time, error)

Time generates a time.Time object from a Date

type Datetime

type Datetime string

Datetime is a date and time in MySQL format

func NewDatetime

func NewDatetime(t time.Time) Datetime

NewDatetime creates a new Datetime from a time.Time object

func Now

func Now() Datetime

Now returns the current time

func (Datetime) Format

func (d Datetime) Format() string

Format returns a textual representation of the time value formatted according to layout, which defines the format by showing how the reference time, defined to be

Mon Jan 2 15:04:05 -0700 MST 2006

would be displayed if it were the value; it serves as an example of the desired output. The same display rules will then be applied to the time value.

func (Datetime) Time

func (d Datetime) Time() (time.Time, error)

Time generates a time.Time object from a Datetime

type Time

type Time string

Time represents a time in MySQL format

func CurrentTime

func CurrentTime() Time

CurrentTime returns the current time in MySQL format

Jump to

Keyboard shortcuts

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