Skip to main content
Glama
pshempel

MCP Time Server Node

by pshempel
timezone-formatting.md695 B
# Timezone Formatting with date-fns-tz (Verified 2025-07-18) **CRITICAL**: Must use `formatInTimeZone` for proper timezone formatting: ```typescript // WRONG - always shows system timezone offset const zonedTime = toZonedTime(now, 'Asia/Tokyo'); format(zonedTime, 'XXX'); // Shows YOUR system offset, not Tokyo's! // CORRECT - shows target timezone offset formatInTimeZone(now, 'Asia/Tokyo', 'XXX'); // '+09:00' formatInTimeZone(now, 'UTC', 'XXX'); // 'Z' ``` **Key Findings**: - `toZonedTime` + `format` = WRONG (shows system timezone) - `formatInTimeZone` = CORRECT (shows target timezone) - UTC displays as 'Z' with 'XXX' format - Empty string timezone works without error (treats as UTC)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pshempel/mcp-time-server-node'

If you have feedback or need assistance with the MCP directory API, please join our Discord server