Skip to content

Cookbook

Real-world recipes for using atemporal in production. Each recipe is a self-contained pattern you can copy and adapt.

Recipes

TopicUse case
REST input validationValidate body.createdAt in Express / Fastify
PrismaMap a Prisma DateTime column to a wrapper
DrizzleMap a Drizzle timestamp column
React Server ComponentsFormat dates on the server in a Next.js app
Cloudflare WorkersCold-start, small bundle, no Node APIs
Structured loggingEmit atemporal error codes to your log stack
Microservice timezonesStoring UTC, rendering locally
Audit log timestampsAppend-only tamper-evident log rows
Business hours schedulingCompute "next business day at 09:00 local"
i18n formattingLocale-aware date/time rendering

All recipes assume import atemporal from 'atemporal' and use the 8 official plugins where applicable.