datetime-timezone

Convert browser local datetimes to UTC for API submission and back for display.

27|11|Updated Dec 21, 2025
One-click install
npx skills add https://github.com/mjunaidca/mjs-agent-skills --skill datetime-timezone
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: datetime-timezone
Source: https://github.com/mjunaidca/mjs-agent-skills/tree/main/docs/taskflow-vault/skills/engineering/datetime-timezone
Command: npx skills add https://github.com/mjunaidca/mjs-agent-skills --skill datetime-timezone

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Correctly handle datetime values across the full stack: browser → API → database → back to browser.

Core Features & Use Cases

  • Store UTC, Display Local: The golden rule guides how to store timestamps in UTC and render them in the user's local time zone.
  • Frontend Patterns: Convert datetime-local input values (local, no TZ) to UTC ISO strings for API storage; convert UTC timestamps from API back to local datetime-local strings for editing.
  • Backend Patterns: Normalize timezone-aware datetimes to UTC for storage; handle conversions in APIs, services, and database queries.
  • Common Scenarios: Scheduling, reminders, due dates, and any time-sensitive UI.

Quick Start

Use the datetime-timezone skill to convert a local datetime input to UTC before sending to API; convert UTC values from API back to local time for display in the UI.

Frequently Asked Questions about datetime-timezone

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I store and display datetime values correctly across frontend, API, and database?

Store all datetime values in UTC in your database, convert local datetime inputs from the browser to UTC before sending to the API, and convert UTC timestamps back to the user's local timezone for display. This prevents misinterpretation of times across different systems and timezones.

Why do datetime-local inputs need conversion before sending to an API?

datetime-local inputs from HTML forms represent local time without timezone information. Converting them to UTC ISO strings before API submission ensures the server stores an unambiguous, timezone-independent timestamp that won't be misinterpreted when retrieved or displayed to users in different timezones.

How do I handle timezone conversions in scheduling and reminder features?

Standardize by storing all scheduled times as UTC in PostgreSQL, normalizing timezone-aware datetimes on the backend by stripping timezone data. When rendering reminders or due dates in the UI, convert UTC values back to the user's local datetime-local format for accurate, localized display.

Does this approach work across both TypeScript frontend and backend applications?

Yes. The UTC storage and conversion pattern applies across frontend, backend, and API layers. TypeScript on both client and server can implement the same standardized workflow: store UTC centrally, convert to local on frontend display, and convert from local to UTC on submission.

What happens if I don't normalize timezone information before storing datetime values?

Without normalization, timezone-aware datetimes stored directly in the database create ambiguity and inconsistency. Users in different timezones see incorrect times, scheduling conflicts occur, and API responses become unreliable. UTC normalization ensures a single source of truth across all systems.