const formatter = new Intl.DateTimeFormat('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false, }) export function formatDateTime(value: string | Date | null | undefined, empty = '—'): string { if (!value) return empty const date = value instanceof Date ? value : new Date(value) if (Number.isNaN(date.getTime())) return empty return formatter.format(date).replace(/\//g, '-') }