@smartput/time
v0.1.2
Published
A clock time, with no date attached.
Maintainers
Readme
@smartput/time
A clock time, with no date attached.
Nanoseconds since midnight, wrapped as a kind. The counterpart to
@smartput/date: together they are what
@smartput/datetime splits into.
Setup
npm add @smartput/timeExample
import { composeLocale, createEngine } from "@smartput/core";
import { english } from "@smartput/core/locale/en";
import { BUILTIN_KINDS } from "@smartput/kinds";
import BUILTIN_EN from "@smartput/kinds/locale/en";
import { datetime } from "@smartput/datetime";
import datetimeEn from "@smartput/datetime/locale/en";
import { time } from "@smartput/time";
const engine = createEngine({
locales: [composeLocale(english, [...BUILTIN_EN, datetimeEn])],
kinds: [...BUILTIN_KINDS, datetime, time],
timeZone: "Europe/Kyiv",
});
engine.evaluate("3pm").formatted // "2026-01-15 15:00 UTC"
engine.evaluate("09:30").formatted // "2026-01-15 09:30 UTC"
engine.evaluate("noon").formatted // "2026-01-15 12:00 UTC"Entry points
| Import | Contents |
| --- | --- |
| @smartput/time | The package root. |
Runtime exports
Type-only exports are erased and do not appear here.
DEFAULT_TIME_WEIGHT · NS_PER_DAY · TIME_KIND · TIME_UNIT · createTime · formatClock · time · unwrap · wrap
Dependencies
What it costs
Ceilings, not measurements. bun run check-size bundles each entry with
bun build --minify and fails if a row crosses its ceiling or drops more
than 30 % below it — a budget that is only an upper bound reports a vanished
graph as a triumph.
| Import | Minified | Gzipped | | --- | --- | --- | | time | ≤ 150 kB | ≤ 52.2 kB |
Generated by scripts/gen-readmes.ts — run bun run docs:readmes. Every
output above was produced by running the line beside it. The full page, with
live demos, is docs/packages/time.md.
