timeparse

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT 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

Overview

Package timeparse holds the lookback / timestamp parsers shared between `bacio history` (CLI) and the HTTP history endpoints. Day (d) and week (w) suffixes are not understood by time.ParseDuration, so we wrap it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lookback

func Lookback(s string) (time.Duration, error)

Lookback extends time.ParseDuration with day (d) and week (w) units. Examples: 30m, 1h, 6h, 1d, 7d, 2w. Single-unit only for d/w; multi-unit composites use Go's native parser.

func Timestamp

func Timestamp(s string) (time.Time, error)

Timestamp accepts several common shapes and returns a UTC time. Date-only and bare datetimes are interpreted in the user's local timezone; RFC 3339 inputs honour the offset they specify.

Accepted: 2006-01-02 | 2006-01-02 15:04 | 2006-01-02 15:04:05 |

2006-01-02T15:04:05 | RFC3339 (e.g. 2026-05-03T07:27:14Z).

Types

This section is empty.

Jump to

Keyboard shortcuts

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