managedtime

package
v7.0.1-rc Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 1 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 managedtime holds the one rule every writer path applies to a managed lifecycle timestamp: the text a write stores is the UTC spelling of the instant, so the stored value of an instant never depends on the host's time zone.

A managed `created_at` / `updated_at` is consumed as text. A consumer writes a DynamoDB condition over the stored attribute, or reads the attribute back and writes it again, and either one compares spellings: RFC3339Nano renders the same instant as "2026-01-02T03:04:05Z" on a UTC host and as "2026-01-02T05:04:05+02:00" on a host set to Europe/Berlin. Normalizing where the clock is read keeps every writer path — put, batch put, transactional put, update and preflight — on the one spelling, and it is what makes a boundary written by a Lambda function (always UTC) comparable with one written by a developer's machine (not always UTC).

A value the caller supplies is not normalized: the contract stores a creation time the model carries verbatim, and re-spelling it would change what the caller wrote.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Now

func Now(clock func() time.Time) time.Time

Now returns the instant a managed write stamps, expressed in UTC.

A nil clock is the wall clock. A configured clock (session.Config.Now, for example) supplies the instant and is honored, but never for its zone: the value is normalized so a caller-injected clock cannot make the stored text depend on anything but the instant it names.

func UTC

func UTC(t time.Time) time.Time

UTC returns the instant a managed write stamps for t, expressed in UTC.

Types

This section is empty.

Jump to

Keyboard shortcuts

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