Skip to main content
Glama

MCP Time Server Node

by pshempel
debug-weekly-timezone.js921 B
#!/usr/bin/env node const { getDay } = require('date-fns'); const { toZonedTime } = require('date-fns-tz'); // UTC: Wednesday Jan 15 at 2 AM // NY: Tuesday Jan 14 at 9 PM const from = new Date('2025-01-15T02:00:00Z'); console.log('From (UTC):', from.toISOString()); console.log('From (UTC) day:', getDay(from), '(0=Sun, 2=Tue, 3=Wed)'); console.log('UTC date check:', from.getUTCDay(), 'should be 3 for Wednesday'); const nyZoned = toZonedTime(from, 'America/New_York'); console.log('\nNY zoned:', nyZoned.toISOString()); console.log('NY zoned day:', getDay(nyZoned), '(0=Sun, 2=Tue)'); // The issue: We're in NY time Tuesday 9 PM // Target: Tuesday 10 PM // Since current time is 9 PM and target is 10 PM, it should be TODAY (Tuesday) // not next week console.log('\nExpected: Today (Tuesday) at 10 PM NY'); console.log('That would be Wednesday 3 AM UTC'); console.log('Expected UTC:', '2025-01-15T03:00:00.000Z');

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