timeutil

package
v1.49.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const TimeStringLayout = "2006-01-02 15:04:05.999999999 -0700 MST"

TimeStringLayout is the layout used by time/Time.String() to create a string representation of a Time value.

Variables

This section is empty.

Functions

func ConvertFormat

func ConvertFormat(cur, curLayout, newLayout string) (string, error)

ConvertFormat converts the time format of cur from curLayout to newLayout.

This is achieved by first attempting to parse cur using old layout. If parsing fails the error is returned verbatim. Usually this indicates that cur did not match curLayout and the caller may act accordingly.

If parsing cur was successful it is converted to newLayout using time/Time.Format().

Types

This section is empty.

Jump to

Keyboard shortcuts

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