Skip to main content
Glama
pshempel

MCP Time Server Node

by pshempel
timezone-validation.md622 B
# Timezone Validation with date-fns-tz (Updated 2025-07-18) Using `getTimezoneOffset()` - Returns NaN for invalid timezones: - `'UTC'`: valid (offset: 0ms) - `'EST'`: valid (offset: -18000000ms) - `'EST5EDT'`: valid (offset: -14400000ms) - `'Invalid/Zone'`: invalid (offset: NaN) - `'America/New_York'`: valid (offset: -14400000ms) - `'Europe/London'`: valid (offset: 3600000ms) - `'Asia/Tokyo'`: valid (offset: 32400000ms) - `'NotATimezone'`: invalid (offset: NaN) - `''`: valid (offset: 0ms - defaults to UTC) **Key Finding**: `getTimezoneOffset()` returns NaN for invalid timezones, making it suitable for validation.

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