common

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const StampLayout = "2006-01-02 15:04:05 -07:00"

StampLayout is the canonical wall-clock layout for any time string handed to a model. The explicit UTC offset is the point: a model reads a bare "2006-01-02 15:04:05" as UTC, so in any non-UTC deployment every zone-less timestamp it sees is misread by the local offset (observed in the field as a phantom "clock skew" bug report from a swarm agent in a UTC+8 container).

Variables

This section is empty.

Functions

func GenUUID

func GenUUID() string

GenUUID returns a random UUID v4 string (xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx).

func Stamp added in v1.7.0

func Stamp(t time.Time) string

Stamp renders t as local wall-clock time with its explicit UTC offset, e.g. "2026-06-10 20:25:00 +08:00".

func StampWithUTC added in v1.7.0

func StampWithUTC(t time.Time) string

StampWithUTC renders t local-with-offset plus its UTC twin, e.g. "2026-06-10 20:25:00 +08:00 (= 2026-06-10 12:25 UTC)". Echoing both back after parsing a model-supplied time makes a timezone mix-up visible at a glance — the cheapest defense against an alarm armed 8 hours off intent.

func ZoneLabel added in v1.7.0

func ZoneLabel() string

ZoneLabel names the process-local timezone, e.g. "HKT (UTC+08:00)". Built from Zone() rather than time.Local.String(), which degrades to "Local" when TZ is unset. Stable for the lifetime of a run (absent a DST flip), so it is safe to embed in prompt-cache-sensitive system prompts.

Types

This section is empty.

Directories

Path Synopsis
Package proc is the single per-OS seam for spawning and managing child processes.
Package proc is the single per-OS seam for spawning and managing child processes.

Jump to

Keyboard shortcuts

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