ctime

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

*------------------------------------------------------------**

  • @filename ctime/time.go
  • @author jinycoo
  • @version 1.0.0
  • @date 2019-07-15 14:06
  • @desc ctime - **------------------------------------------------------------*

Index

Constants

View Source
const (
	PRCDiff         = 28800
	LayoutShortDate = "20060102"
	LayoutDate      = "2006-01-02"
	LayoutDatetime  = "2006-01-02 15:04:05"
)

Variables

This section is empty.

Functions

func DiffMilli

func DiffMilli(d time.Duration) int64

func Now

func Now() int64

func PRCLocal

func PRCLocal() *time.Location

func TimeToMillis

func TimeToMillis(t time.Time) int64

func Today

func Today() time.Time

Types

type ClassTime

type ClassTime string

func (ClassTime) Abbr

func (ct ClassTime) Abbr() string

func (ClassTime) ParseDateFormat

func (ct ClassTime) ParseDateFormat(date JsonTime) string

func (ClassTime) ParseDateUnix

func (ct ClassTime) ParseDateUnix(date JsonTime) int64

func (ClassTime) SubTime

func (ct ClassTime) SubTime(index int8) string

type Duration

type Duration time.Duration

func (Duration) Shrink

Shrink will decrease the duration by comparing with context's timeout duration and return new timeout\context\CancelFunc.

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(text []byte) error

type JsonTime

type JsonTime time.Time

func (JsonTime) In

func (j JsonTime) In() JsonTime

func (JsonTime) MarshalJSON

func (j JsonTime) MarshalJSON() ([]byte, error)

func (JsonTime) String

func (j JsonTime) String(layout string) string

func (JsonTime) Unix

func (j JsonTime) Unix() int64

type Time

type Time int64

Jump to

Keyboard shortcuts

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