timeconv

package
v2.4.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 2, 2017 License: Apache-2.0 Imports: 2 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

Overview

Package timeconv contains utilities for converting time.

The gRPC/Protobuf libraries contain time implementations that require conversion to and from Go times. This library provides utilities and convenience functions for performing conversions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(ts *timestamp.Timestamp, layout string) string

Format formats a *timestamp.Timestamp into a string.

This follows the rules for time.Time.Format().

func Now

func Now() *timestamp.Timestamp

Now creates a timestamp.Timestamp representing the current time.

func String

func String(ts *timestamp.Timestamp) string

String formats the timestamp into a user-friendly string.

Currently, this uses the 'time.ANSIC' format string, but there is no guarantee that this will not change.

This is a convenience function for formatting timestamps for user display.

func Time

func Time(ts *timestamp.Timestamp) time.Time

Time converts a protobuf *timestamp.Timestamp to a time.Time.

func Timestamp

func Timestamp(t time.Time) *timestamp.Timestamp

Timestamp converts a time.Time to a protobuf *timestamp.Timestamp.

Types

This section is empty.

Jump to

Keyboard shortcuts

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