timestamp

package
v0.47.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package timestamp owns lossless RFC 3339 admission for protocol timestamps.

Example
package main

import (
	"fmt"
	"time"

	"github.com/Tangerg/scope/core/timestamp"
)

func main() {
	instant := time.Date(2026, 1, 1, 0, 0, 0, 123456789, time.UTC)
	fmt.Println(timestamp.Validate(instant) == nil)
	withSeconds := instant.In(time.FixedZone("seconds", 43))
	fmt.Println(timestamp.Validate(withSeconds) == nil)
}
Output:
true
false

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(value time.Time) error

Validate accepts omitted zero times or timestamps that JSON can preserve. Optional timestamp fields must use omitzero; the zero instant is treated as absent even when its location has an otherwise unrepresentable offset.

Types

This section is empty.

Jump to

Keyboard shortcuts

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