timeutil

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatLocal

func FormatLocal(utc string) string

FormatLocal converts a UTC timestamp string to the configured display timezone using the default layout ("2006-01-02 15:04:05"). When ENGRAM_TIMEZONE is unset or invalid it falls back to system local time. Unparseable input is returned as-is.

Accepted input layouts: "2006-01-02 15:04:05" (SQLite style), time.RFC3339, time.RFC3339Nano.

func FormatLocalWithLayout

func FormatLocalWithLayout(utc, layout string) string

FormatLocalWithLayout is the layout-aware variant of FormatLocal. It applies the same timezone conversion rules and accepts the same input formats, but renders the output with the caller's layout. Use this when a UI surface (e.g. the dashboard) needs a specific display style while still honoring ENGRAM_TIMEZONE.

If the input cannot be parsed in any of the accepted layouts, the original string is returned unchanged so callers never lose data on malformed timestamps.

Types

This section is empty.

Jump to

Keyboard shortcuts

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