timeutil

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: MIT 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 timeutil holds the single timezone Second Brain resolves calendar boundaries and renders dates in.

It exists because the process's own local timezone is NOT a safe default: the server and collector containers run as Etc/UTC, while the developer machines, the users, and every ingested document are Korea-based. Code that reaches for time.Now().Location() therefore behaves one way in tests and a different way in production — silently, and off by nine hours. Anything that answers "which calendar day/week/month is this?" or renders a date for a human (or for an LLM prompt) must go through KST rather than the process local zone.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KST

func KST() *time.Location

KST returns the Asia/Seoul location. It never returns nil, so callers can use it directly in time.Date / Time.In without a nil check.

time.LoadLocation reads the OS tzdata database; the production image (Dockerfile's runtime-base stage) installs the tzdata package for exactly this reason. The time.FixedZone fallback only matters for an environment without a tzdata database (e.g. a minimal test sandbox, or a scratch image) — Korea has observed no DST since 1988, so a fixed UTC+9 offset is equivalent to the IANA zone at every point in time this system deals with, not merely an approximation. Falling back rather than panicking keeps a missing tzdata package from taking the whole service down.

Types

This section is empty.

Jump to

Keyboard shortcuts

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