timeutils

package
v1.7.1-rc3 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2015 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// RFC3339NanoFixed is our own version of RFC339Nano because we want one
	// that pads the nano seconds part with zeros to ensure
	// the timestamps are aligned in the logs.
	RFC3339NanoFixed = "2006-01-02T15:04:05.000000000Z07:00"
	// JSONFormat is the format used by FastMarshalJSON
	JSONFormat = `"` + time.RFC3339Nano + `"`
)

Variables

This section is empty.

Functions

func FastMarshalJSON

func FastMarshalJSON(t time.Time) (string, error)

FastMarshalJSON avoids one of the extra allocations that time.MarshalJSON is making.

func GetTimestamp added in v1.7.0

func GetTimestamp(value string) string

GetTimestamp tries to parse given string as RFC3339 time or Unix timestamp (with seconds precision), if successful returns a Unix timestamp as string otherwise returns value back.

Types

This section is empty.

Jump to

Keyboard shortcuts

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