Skip to main content
Glama
datetime.ts528 B
/** * 将JavaScript Date对象格式化为本地日期时间字符串 * 格式为:YYYY/MM/DD HH:MM:SS * @param date 日期对象 * @returns 格式化后的日期时间字符串 */ export function formatLocalDateTime(date: Date): string { if (!date) return ''; // 使用中文环境的本地化格式 return date.toLocaleString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false }).replace(/\//g, '/'); }

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/aiuluna/knowledge-graph-mcp'

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